IAuthorizationPolicy Interface


Defines a set of rules for authorizing a user, given a set of claims.

Namespace:   System.IdentityModel.Policy
Assembly:  System.IdentityModel (in System.IdentityModel.dll)

public interface IAuthorizationPolicy : IAuthorizationComponent


Gets a string that identifies this authorization component. (Inherited from IAuthorizationComponent.)


Gets a claim set that represents the issuer of the authorization policy.

System_CAPS_pubmethodEvaluate(EvaluationContext, Object)

Evaluates whether a user meets the requirements for this authorization policy.

Implement the IAuthorizationPolicy interface to add or map one set of claims to another. An authorization policy examines a set of claims and adds additional claims based on the current set. For example, an authorization policy might evaluate a claim that contains the date of birth and add a claim that asserts that the user is over 21 years old and add an Over21 claim to the EvaluationContext.

Classes that implement the IAuthorizationPolicy interface do not authorize users, but they enable the ServiceAuthorizationManager class to do so. The ServiceAuthorizationManager calls the Evaluate method for each authorization policy in effect. The Evaluate method determines whether additional claims should be added for the user, based on the current context. An authorization policy's Evaluate method may be called multiple times, as claims are added to the EvaluationContext by other authorization policies. When all authorization policies in effect are done, the ServiceAuthorizationManager class makes authorization decisions based upon the final set of claims. The ServiceAuthorizationManager class then creates an AuthorizationContext that contains an immutable set of claims that reflects these authorization decisions.

Snippet section 1 of code snippet {"project_id":"3fedad16-eaf1-41a6-8f96-0c1949c68f32","entity_id":"f1f93d15-9234-4cef-a131-c55c3ed1fb93","entity_type":"CodeSnippet","locale":"en-US"} in source file ({"filename":"/cs/service.cs","blob_type":"Source","blob_id":"-002fcs-002fservice-002ecs","blob_revision":2}) overlaps with other snippet sections. Ensure the tags are placed correctly.

.NET Framework
Available since 3.0
Return to top
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2015 Microsoft