mirror of https://github.com/abpframework/abp
parent
3993d8d78e
commit
3803b5b73a
@ -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