ServiceAuthorizationBehavior.ServiceAuthorizationManager Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets or sets the service authorization manager.

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

Public Property ServiceAuthorizationManager As ServiceAuthorizationManager

Property Value

Type: System.ServiceModel.ServiceAuthorizationManager

The service authorization manager.

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.

Dim myServiceHost As New ServiceHost(GetType(Calculator), baseUri)
Dim myServiceBehavior As ServiceAuthorizationBehavior = myServiceHost.Description.Behaviors.Find(Of ServiceAuthorizationBehavior)()
myServiceBehavior.PrincipalPermissionMode = PrincipalPermissionMode.UseAspNetRoles
Dim sm As New MyServiceAuthorizationManager()
myServiceBehavior.ServiceAuthorizationManager = sm

.NET Framework
Available since 3.0
Return to top