Configuring Windows authentication for ASP.NET using local workgroups?

I have a requirement for creating Windows authentication for our web applications. We plan to create local workgroups (on Windows 2008 Server) to manage users instead of Active Directory. Our reason is that it takes several months to create groups and move users through AD (and our client would prefer that we go along this route). Can I configure Windows authentication for an asp.net application and verify user credentials for local workgroups? Keep in mind that we will try to match their names to enter our local workgroups.

0
source share
1 answer

You can use AspNetWindowsTokenRoleProvider. This forces ASP.net to use local Windows groups.

Do something similar in your web configuration.

<authentication> section enables configuration of the security authentication mode used by ASP.NET to identify an incoming user. --> <authentication mode="Windows"/> <identity impersonate="false"/> <authorization> </authorization> <roleManager enabled="true" defaultProvider="AspNetWindowsTokenRoleProvider"/> 

then in your aspx you can check if the user exists in the role. I posted this on my homepage.

 If Not Roles.IsUserInRole(Context.Current.User.identity.name, "Managers") Then 'label1.Text = "You are not authorized to view user roles." 

Response.Redirect (Request.ApplicationPath and "\ logout.html")

 end if 

You can learn more from this link from Microsoft http://msdn.microsoft.com/en-us/library/ff647401.aspx under Using WindowsTokenRoleProvider

+3
source

All Articles