The Active Directory Login Page

AsifCh

Well-known member
Joined
Oct 14, 2003
Messages
59
Location
Islamabad (Pakistan)
Hi,

I want to create a login page which authinticates the users from the active directory. The requirement is that if the user is loged in to the windows through the active directory account then he has not to provide the user name and password other wise he has to provide the both things. The users active directory group is maped to the applications roles. First i have to check the users Active Directory Group and then get the role of the user for application. Can you provide me the best solution for how to do this because I am not sure how to authinticate the users in the login page.

Regards,
 
If you have IIS configured to use Windows Authentication (and remove allow anonymous) and in your web.config have the authentication mode set to Windows then it should automatically use your Domain for authentication.
If a person is logged in then no prompting should occur, if they are accessing the site from outside your domain then a login prompt should automatically be displayed.
Once logged in you can check the group membership with code similar to
Code:
If User.IsInRole("<role goes here>") Then
    Member of role
End If
 
Last edited by a moderator:
Hi,

thanks for the reply. You are right that I can check the users role through user.isInRole but the problem is that Their are more then 100 different groups in the active directory and each group has some specific permissions so using the User.isInRole is not appropriate at this situation because I have to loop through the whole list of roles, so i want a solution that i can get the users active directory directly.

Thanks,
-----
 
Hello
I also need to login using active directory. Please let me know if you find any solution.
thanks
 
Back
Top