|The Sandbox||AzMan in the Enterprise - Sample Code||2||Apr 04, 2007 at 3:15 PM|
|The Sandbox||Programming AzMan - Sample Code||1||Mar 08, 2007 at 1:34 PM|
Thanks! The great thing about using the WindowsPrincipal and WindowsIdentity objects is that there is no set up required – yet these encapsulate information about Windows accounts whether the machine is domain attached or not. Therefore, simply pull in the appropriate namespace(s) and instantiate the objects required for either your single or repeated validation use. From there, if desired, the developer can interrogate the Name property to evaluate for a specific DOMAIN\ requirement for access to the application. The application could then be terminated with an error prompt based on the evaluation or possibly pop up another form to collect credentials for authentication to another identity store. Also, the Type property shows the type of authentication used to identify the user – Kerberos, NTLM, etc. There may be business reasons for the application to also make decisions based on this information.
It appears that you need to adjust your syntax just a bit to:
This should fix it.