O'Reilly logo

C#® Developer's Guide to ASP.NET, XML, and ADO.NET by Chris Kinsman, Jeffrey P. McManus

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Custom Roles with Forms Authentication

We have discussed so far how to authenticate a user with forms authentication. This process gives you an identity to authorize against. With Windows authentication, you have both an identity and a list of roles to authorize against. How do you use role mappings with forms authentication to authorize against?

With a little work, you can add roles to the forms authentication model. You will use the web.config in Listing 7.11, which defines the roles that are required for access to various URLs in the application.

Listing 7.11. Web.config That Uses Location Mapping and URL Authorization to Map Roles to Application Locations
 <?xml version="1.0" encoding="utf-8" ?> <configuration> <system.web> <authentication ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required