Define Principal object.- It represents the security context under which code is running.
- The principal object contains information about a user’s identity and role.
- It represents authenticated users.
- You have a Principal Permission object in .Net framework that specifies user and its role.
- It has Demand() method that checks the current user or principal against the name and role specified in the Principal Permission.
- It encapsulates identity and the role of a user.
- It can be created with the help of identity and role of a user.
There are two types of principal objects:
- The role-based security can be implemented with the help of principal objects.
- GenericPrinciple encapsulates the identity object and the role.
- WindowsPrincipal stores identity and the windows group membership of the user.