If You Store Role Information in a Custom Store, Create a Custom Authorization Policy
- J.D. Meier, Carlos Farre, Jason Taylor,
Prashant Bansode, Steve Gregersen, Madhu Sundararajan, Rob Boucher
If your application stores authorization data in a custom store such as a SQL Server database, create a custom authorization policy to authorize your users.
To create a custom authorization policy, you will implement a class derived from
along with an Evaluate
method that you can customize for your user authorization policy.
The Policy library is configured in the config file or in code. The following example configures the policy location in the config file:
<serviceAuthorization serviceAuthorizationManagerType="Microsoft.ServiceModel.Samples.MyServiceAuthorizationManager, service">
<!-- The serviceAuthorization behavior allows one to specify custom authorization policies. -->
<add policyType="Microsoft.ServiceModel.Samples.CustomAuthorizationPolicy.MyAuthorizationPolicy, PolicyLibrary" />