I created asp.net webpage , i want to log on my asp page using windows username and password when login button click. i have search some code(http://www.codeproject.com/Articles/37558/Windows-Authentication-Using-Form-Authentication) in net for login my asp page. It works for my local user name and password but i want to access Specific domain group members to my asp.net page
Someone help me…
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
To provide/restrict access to specific users/groups, appropriate entries needs to be done in Web.config.
In Windows authentication names are entered in the format DomainNameUserName or ComputerNameUserName.
You need to use the same format when listing users in the authorization rules. For example, if you have the user accounts john and nolan on a computer named FARIAMAT, you can use these authorization rules. Note the users attribute in <allow> element.
<authorization> <deny users="?" /> <!-- permit only specific users to have access --> <allow users="FARIAMATjohn,FARIAMATnolan" /> <deny users="*" /> </authorization>
To permit all users of an NT Group named Managers to have access to your resources, use the following code. Note the roles attribute in <allow> element.
<configuration>
<system.web>
<authorization>
<!-- Format is:: <allow roles="DomainNameWindowsGroup" /> -->
<allow roles="domainnameManagers" />
<deny users="*" />
</authorization>
</system.web>
</configuration>
NOTE::
Windows groups are used as roles and they take the form domainNamewindowsGroup. Groups such as Administrators are referenced by using the BUILTIN prefix as:
<authorization> <allow users="DomainNamejohn, DomainNamenolan" /> <allow roles="BUILTINAdministrators, DomainNameManager" /> <deny users="*" /> </authorization>
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0