Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ServiceAuthorizationManager::CheckAccessCore Method (OperationContext^)

 

Checks authorization for the given operation context based on default policy evaluation.

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

protected:
virtual bool CheckAccessCore(
	OperationContext^ operationContext
)

Parameters

operationContext
Type: System.ServiceModel::OperationContext^

The OperationContext for the current authorization request.

Return Value

Type: System::Boolean

true if access is granted; otherwise, false. The default is true.

ServiceSecurityContext is generally the result from the default policy evaluation.

Override this method to provide custom authorization decisions.

This method can be used to make authorization decisions based on claim sets that are inferred based on incoming tokens, or added through external authorization policies. It can also make authorization decisions based on properties of the incoming message: for example, the action header.

In this method, the application can use the operationContext parameter to access the caller identity (ServiceSecurityContext). By returning the RequestContext object from the RequestContext property, the application can access the entire request message (RequestMessage). By returning the MessageHeaders object from the IncomingMessageHeaders property, the application can access the service URL (To) and the operation (Action). With this information, the application can perform the authorization decision accordingly.

The claims made by a user are found in the ClaimSet returned by the ClaimSets property of the AuthorizationContext. The current AuthorizationContext is returned by the ServiceSecurityContext property of the OperationContext class.

The following example shows an override of the CheckAccessCore method.

No code example is currently available or this language may not be supported.

For another example, see How to: Create a Custom Authorization Manager for a Service.

.NET Framework
Available since 3.0
Return to top
Show:
© 2017 Microsoft