@ -38,12 +38,8 @@ Then add the `DynamicClaims` middleware.
````csharp
````csharp
public override void OnApplicationInitialization(ApplicationInitializationContext context)
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
{
//...
// Add this line before UseAuthorization.
app.UseAuthentication();
// Add this line after UseAuthentication
app.UseDynamicClaims();
app.UseDynamicClaims();
app.UseAuthorization();
app.UseAuthorization();
//...
//...
}
}
@ -68,6 +64,8 @@ This implementation is used for the `Tiered` solution. It will get the dynamic c
If you want to add your own dynamic claims contributor, you can a class that implement the `IAbpDynamicClaimsPrincipalContributor` interface. The framework will call the `ContributeAsync` method when get the dynamic claims.
If you want to add your own dynamic claims contributor, you can a class that implement the `IAbpDynamicClaimsPrincipalContributor` interface. The framework will call the `ContributeAsync` method when get the dynamic claims.
> It better to use cache to improve performance.
## AbpClaimsPrincipalFactoryOptions
## AbpClaimsPrincipalFactoryOptions
* `IsDynamicClaimsEnabled`: Enable or disable the dynamic claims feature.
* `IsDynamicClaimsEnabled`: Enable or disable the dynamic claims feature.