Export (0) Print
Expand All

ServiceAuthorizationBehavior.ServiceAuthorizationManager Property

Gets or sets the service authorization manager.

Namespace:  System.ServiceModel.Description
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

public ServiceAuthorizationManager ServiceAuthorizationManager { get; set; }

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.

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

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;

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0

Community Additions

ADD
Show:
© 2014 Microsoft