mirror of https://github.com/abpframework/abp.git
10 changed files with 83 additions and 11 deletions
@ -0,0 +1,37 @@ |
|||||
|
using System.Threading.Tasks; |
||||
|
using Microsoft.Extensions.Options; |
||||
|
using OpenIddict.Abstractions; |
||||
|
using OpenIddict.Server; |
||||
|
|
||||
|
namespace Volo.Abp.OpenIddict.WildcardDomains; |
||||
|
|
||||
|
public class AbpValidateAuthorizedParty : AbpOpenIddictWildcardDomainBase<OpenIddictServerHandlers.Session.ValidateAuthorizedParty, OpenIddictServerEvents.ValidateLogoutRequestContext> |
||||
|
{ |
||||
|
public static OpenIddictServerHandlerDescriptor Descriptor { get; } |
||||
|
= OpenIddictServerHandlerDescriptor.CreateBuilder<OpenIddictServerEvents.ValidateLogoutRequestContext>() |
||||
|
.UseScopedHandler<AbpValidateAuthorizedParty>() |
||||
|
.SetOrder(OpenIddictServerHandlers.Session.ValidateToken.Descriptor.Order + 1_000) |
||||
|
.SetType(OpenIddictServerHandlerType.BuiltIn) |
||||
|
.Build(); |
||||
|
|
||||
|
public AbpValidateAuthorizedParty( |
||||
|
IOptions<AbpOpenIddictWildcardDomainOptions> wildcardDomainsOptions, |
||||
|
IOpenIddictApplicationManager applicationManager) |
||||
|
: base(wildcardDomainsOptions, new OpenIddictServerHandlers.Session.ValidateAuthorizedParty(applicationManager)) |
||||
|
{ |
||||
|
Handler = new OpenIddictServerHandlers.Session.ValidateAuthorizedParty(applicationManager); |
||||
|
} |
||||
|
|
||||
|
public async override ValueTask HandleAsync(OpenIddictServerEvents.ValidateLogoutRequestContext context) |
||||
|
{ |
||||
|
Check.NotNull(context, nameof(context)); |
||||
|
Check.NotNull(context.IdentityTokenHintPrincipal, nameof(context.IdentityTokenHintPrincipal)); |
||||
|
|
||||
|
if (await CheckWildcardDomainAsync(context.PostLogoutRedirectUri)) |
||||
|
{ |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
await Handler.HandleAsync(context); |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue