Define Principal object - .Net Code Security

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:

1. GenericPrincipal
2. WindowsPrincipal

- 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.
Define declarative and imperative security - .Net Code Security
.Net Code Security - Security checks can be applied imperatively or declaratively. Declarative security is applied by associating attribute declarations...
Define role-based security - .Net Code Security
.Net Code Security - Role-based security is to verify the role and/or identity of the current Principal object......
Explain code access security - .Net Code Security
.Net Code Security - Code access security protects code from unauthorized calls. You can prevent access to the system resources using Permission object....
Post your comment