Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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 user's active directory group is maped to the application's roles. First i have to check the user's 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,

Asif Raza Ashraf

Senior Software Engineer

Electronic Solutions Pakistan

Islamabad

  • Administrators
Posted (edited)

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

If User.IsInRole("") Then
   'Member of role
End If

Edited by PlausiblyDamp

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted

Hi,

 

thanks for the reply. You are right that I can check the user's 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 user's active directory directly.

 

Thanks,

-----

Asif Raza Ashraf

Senior Software Engineer

Electronic Solutions Pakistan

Islamabad

  • 3 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...