ServiceAuthorizationBehavior.ServiceAuthorizationManager Property

Definition

Gets or sets the service authorization manager.

C#
public System.ServiceModel.ServiceAuthorizationManager ServiceAuthorizationManager { get; set; }

Property Value

The service authorization manager.

Examples

The following code shows how to set this property to use a custom service authorization manager.

C#
ServiceHost myServiceHost = new ServiceHost(typeof(Calculator), baseUri);
ServiceAuthorizationBehavior myServiceBehavior =
    myServiceHost.Description.Behaviors.Find<ServiceAuthorizationBehavior>();
myServiceBehavior.PrincipalPermissionMode =
    PrincipalPermissionMode.UseAspNetRoles;
MyServiceAuthorizationManager sm = new MyServiceAuthorizationManager();
myServiceBehavior.ServiceAuthorizationManager = sm;

Remarks

The ServiceAuthorizationManager class is responsible for evaluating all policies, chaining forward and backward, optionally connecting the resulting AuthorizationContext to the ServiceSecurityContext and returning the authorization decision of true or false to allow or deny access.

Applies to

Produit Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

See also