Custom ASP.NET Windows Authentication with Custom Roles

If I use Windows authentication in an ASP.NET application and I want to use my own roles instead of using Windows security groups as roles, do I need to write my own role provider? The solution should be able to map Windows users and groups to specific application roles.

+4
source share
2 answers

If I understand your question, you do not need to use roles from Active Directory security groups as roles for your ASP.NET application. And you don’t need to implement a custom role provider. By default, roles are simply retrieved from the ASP.NET application database.

In this database, you can simply create specific roles created using the aspnet_regsql.exe utility (in the folder with the .NET 2.0 framework).

Probably the largest collections of resources / information on this topic: http://weblogs.asp.net/scottgu/archive/2006/02/24/ASP.NET-2.0-Membership_2C00_-Roles_2C00_-Forms-Authentication_2C00_-and-Security-Resources -aspx

+2
source

In fact, you can use the built-in ASP.NET configuration website. You must temporarily switch to Internet mode. Then you can add users DOMAIN\username as a username, enter a password (it will not be used after you return), you can assign their roles. After switching to Windows mode, these users will be used automatically.

0
source

All Articles