asp.net - Custom implementation of IPrincipal throws System.SystemException: The trust relationship -
We have an ASP.NET site that relies on form authentication for the requested login credentials, although implementation of the IPrincipal is complete
However, when a site is run on a particular server (which is semi-rigid in terms of security), crashing on IPrincipal.IsInRole () during application messaging Gets:
System.SystemException: Primary Domain and Wish Reliable fail trust relationships between domains.
This indicates a communication error between web-server and DC, however, since our application is not exactly using Windows authentication, I do not know why it is necessary to communicate with DC .
This is my implementation:
[serialable] public class custom principal: IPrincipal {public custom principals (IUser userObj) {this.Identity = New CustomIdentity (userObj.Id) , UserObj.Username); } Public Bull Isinol (string roll) {if (roll == empty) returned incorrect; Var roles = hpptex Running Session ["Authentication-roles"] as string []; If (roles == faucet) return false; Return Array.IndexOf (roles, roles) & gt; = 0; } Public Identity Identity {Received; Private set; } Public Customimity Full Identity {Receive (Retail Identity)). IDENTITY; }}}
Debugging it locally (where it works) This is a true implementation that is actually running. The usage is as follows:
Public override zero submission () {var items = this.manager.Items. Where (i = & gt; engine music.);
Setting a breakpoint here gives me that EngineContext.CurrentUser is actually implementing custom principals.
Has anyone experienced this? How is it possible that ASP.NET still triggers any LDAP-lookup on an interface method?
I have found this, but in my environment both webs-server and DC 2008 R2, so this mustn is not applicable though, there are some errors in my event log, which indicates that DC There are some communication problems, but since we do not trust LDAP, then this should not be a problem.
Security system server could not establish a secure connection with ldap / ddc.domain.com / xxxxxxxxxxxxx. No authentication protocol was available.
The server has come out of my area, which means that I can not fix it myself, but I get a support ticket for this, but it can be deliberate for security reasons. This setup for (even if it seems dumb).
Has anyone experienced this problem?
Follow-up: Stack trace shows:
On the system Security. Principal. NTCount. Security in translattoids (signal system). Principal. NTAccount TransSatel (Identity ReferanceCollection Source Aidets, Type Type Type, Boolean Force Sign) system Security Principal. Windows Principal. Role of Ice Innol String) in the Company. Sites. Manager.WeConPontentsMenu Component Lieutenant; Gt; B. 00 (Inhication Element i)
Edit:
I was finally able to reproduce it on error on my dev-machine (I got my machine from DC Yesterday was canceled, but it has not reproduced it until now)
HTTP Contex The user is actually a WindowsPrincipal by default, and the error in my code was that I will only replace it with the customprint on login. Therefore, uncertified users still receive Windows principals, which then fails critically if you have trust issues on your AD.
I have tried to apply it when I started the application
AppDomain .content domain .set principal policy (principal policy. Principal);
But it does not seem that how do I change the default principal in ASP.NET? I thought it was the WindowsAuthenticationModule that was added to WindowsPrincipal for HttpContext.User, but by removing it just now. Also given the same issue it was contained in this article:
I tried to set AppDomain.CurrentDomain.SetPrincipalPolicy (Principal Policy. Principal);
Appstart and OnAuthenticateRequest Recommended but
However, it works (in OnAuthenticateRequest):
context.User = new GenericPrincipal (New GenericIdentity (String.Empty) , New string [0]);
I Thanks for every input you will compromise for now!
Comments
Post a Comment