Hi
In my active directory define user with "logonto computer" to user only logon to special user.for example i define 'bgs009' user with logonto property 'all computer' and 'bgs010' with logon to 'bgs005' that this user only logon to 'bgs005' computer.
In my asp.net program i try authenticate user against active directory.but for user 'bgs009' is successfull but user 'bgs010' always fail with this message "user name or bad password".i publish my website on 'server01' server.Now if i in active directory change logonto property 'bgs010' user to logon to 'bgs005,server01' user authentication is successfull.
Why?
please help me.
thank you
Loading

Hemant KumarRank #1,202 · 1.5K reputationPosted Oct 17, 2011, 8:06 PM EDT
The Above code authenticates the user on the activie directory, authentication request and authentication response are objects to get the information from the use. internal static AuthenticationResponse Authenticate(AuthenticationRequest authenticationRequest) { AuthenticationResponse authenticationResponse = new AuthenticationResponse(); string LDAPPath = GetLDAPPath(); string domainName = //Your Domain Name; try { DirectoryEntry directoryEntry = new DirectoryEntry(LDAPPath + domainName, authenticationRequest.UserName, authenticationRequest.Password.Value); object obj = directoryEntry.NativeObject; authenticationResponse.IsAuthenticated = true; authenticationResponse.Message = Constants.AUTHENTICATION_SUCESSFUL; } catch (System.Exception exception) { authenticationResponse.IsAuthenticated = false; authenticationResponse.Message = exception.Message; } return authenticationResponse; } private static string GetLDAPPath() { return "LDAP://"; }Let me know if this is useful thanks!
http://msdn.microsoft.com/en-us/library/ms180890(v=VS.90).aspx