Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>After some more investigation I found <a href="http://msdn.microsoft.com/en-us/library/bb154889%28v=vs.90%29.aspx" rel="nofollow">this</a> on MSDN which states:</p> <blockquote> <p>The <strong>ValidateCredentials</strong> method binds to the server specified in the constructor. If the username and password parameters are null, the credentials specified in the constructor are validated. If no credential were specified in the constructor, and the username and password parameters are null, <strong>this method validates the default credentials for the current principal.</strong> </p> </blockquote> <p>and together with this information in the documentation of the <a href="http://msdn.microsoft.com/en-us/library/bb298328%28v=vs.90%29.aspx" rel="nofollow">constructor</a> of <code>PrincipalContext</code>:</p> <blockquote> <p>public PrincipalContext(System.DirectoryServices.AccountManagement.ContextType contextType, string name):<br> <strong>contextType:</strong> A System.DirectoryServices.AccountManagement.ContextType enumeration value specifying the type of store for the principal context.<br> <strong>name:</strong> The name of the domain or server for System.DirectoryServices.AccountManagement.ContextType.Domain context types, the machine name for System.DirectoryServices.AccountManagement.ContextType.Machine context types, or the name of the server and port hosting the System.DirectoryServices.AccountManagement.ContextType.ApplicationDirectory instance. <strong>If the name is null for a System.DirectoryServices.AccountManagement.ContextType.Domain context type this context is a domain controller for the domain of the user principal under which the thread is running.</strong> If the name is null for a System.DirectoryServices.AccountManagement.ContextType.Machine context type, this is the local machine name. This parameter cannot be null for System.DirectoryServices.AccountManagement.ContextType.ApplicationDirectory context types.</p> </blockquote> <p>This leads me to conclude that since I don't use the <code>name</code> property in the constructor of the <code>PrincipalContext</code>, the domain controller will run under my own principal when on my dev machine. This could mean that it uses my users priveliges, which of course are much higher than the machine accounts the production servers are running as. This in turn could make all calls to <code>Validate</code> with <code>null</code>as password automatically validate due to the higher level of privelige.</p> <p>At least, this is my theory... Comments and thoughts are welcome, I will be closing this question soon.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload