Browse Source
Merge pull request #20045 from abpframework/AbpDynamicClaimsOpenIddictClaimsPrincipalHandler
Skip create dynamic claims when request is `ClientCredentials`.
pull/20092/head
Engincan VESKE
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
6 additions and
0 deletions
-
modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Claims/AbpDynamicClaimsOpenIddictClaimsPrincipalHandler.cs
|
|
|
@ -1,5 +1,6 @@ |
|
|
|
using System.Threading.Tasks; |
|
|
|
using Microsoft.Extensions.DependencyInjection; |
|
|
|
using OpenIddict.Abstractions; |
|
|
|
using Volo.Abp.DependencyInjection; |
|
|
|
using Volo.Abp.Security.Claims; |
|
|
|
|
|
|
|
@ -9,6 +10,11 @@ public class AbpDynamicClaimsOpenIddictClaimsPrincipalHandler: IAbpOpenIddictCla |
|
|
|
{ |
|
|
|
public virtual async Task HandleAsync(AbpOpenIddictClaimsPrincipalHandlerContext context) |
|
|
|
{ |
|
|
|
if (context.OpenIddictRequest.IsClientCredentialsGrantType()) |
|
|
|
{ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
var abpClaimsPrincipalFactory = context |
|
|
|
.ScopeServiceProvider |
|
|
|
.GetRequiredService<IAbpClaimsPrincipalFactory>(); |
|
|
|
|