Applications that use Forms authentication will often want to use the GenericPrincipal class (in conjunction with the FormsIdentity class), to create a non-Windows specific authorization scheme, independent of a Windows domain.
For example, an application may:
Use Forms authentication to obtain user credentials (user name and password).
Validate the supplied credentials against a data store; for example, a database or Microsoft® Active Directory® directory service.
Create GenericPrincipal and FormsIdentity objects based on values retrieved from the data store. These may include a user’s role membership details.
Use these objects to make authorization decisions.
This How To describes how to create a Forms-based Web application that authenticates users and creates a custom Forms authentication ticket that contains user and role information. It also shows you how to map this information into GenericPrincipal and FormsIdentity objects and associate the new objects with the HTTP Web request context, allowing them to be used for authorization logic within your application.
This How To focuses on the construction of the GenericPrincipal and FormsIdentity objects together with the processing of the forms authentication ticket. For details about how to authenticate users against Active Directory and SQL Server 2000, see the following related How Tos in the Reference section of this book: