Browse Source

Add FrontChannelLogoutUri property and related methods to OpenIddict application classes

pull/23196/head
maliming 7 months ago
parent
commit
c70a9bc9f3
No known key found for this signature in database GPG Key ID: A646B9CB645ECEA4
  1. 9
      modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Applications/AbpApplicationDescriptor.cs
  2. 11
      modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Applications/AbpApplicationManager.cs
  3. 7
      modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Applications/AbpOpenIddictApplicationStore.cs
  4. 2
      modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Applications/IAbpOpenIdApplicationStore.cs
  5. 9
      modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Applications/OpenIddictApplicationModel.cs

9
modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Applications/AbpApplicationDescriptor.cs

@ -4,13 +4,18 @@ namespace Volo.Abp.OpenIddict.Applications;
public class AbpApplicationDescriptor : OpenIddictApplicationDescriptor
{
/// <summary>
/// Gets or sets the front-channel logout URI associated with the application.
/// </summary>
public virtual string FrontChannelLogoutUri { get; set; }
/// <summary>
/// URI to further information about client.
/// </summary>
public string ClientUri { get; set; }
public virtual string ClientUri { get; set; }
/// <summary>
/// URI to client logo.
/// </summary>
public string LogoUri { get; set; }
public virtual string LogoUri { get; set; }
}

11
modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Applications/AbpApplicationManager.cs

@ -44,6 +44,7 @@ public class AbpApplicationManager : OpenIddictApplicationManager<OpenIddictAppl
if (descriptor is AbpApplicationDescriptor model)
{
model.FrontChannelLogoutUri = application.FrontChannelLogoutUri;
model.ClientUri = application.ClientUri;
model.LogoUri = application.LogoUri;
}
@ -55,11 +56,21 @@ public class AbpApplicationManager : OpenIddictApplicationManager<OpenIddictAppl
if (descriptor is AbpApplicationDescriptor model)
{
application.FrontChannelLogoutUri = model.FrontChannelLogoutUri;
application.ClientUri = model.ClientUri;
application.LogoUri = model.LogoUri;
}
}
public virtual async ValueTask<string> GetFrontChannelLogoutUriAsync(object application, CancellationToken cancellationToken = default)
{
Check.NotNull(application, nameof(application));
Check.AssignableTo<IAbpOpenIdApplicationStore>(application.GetType(), nameof(application));
return await Store.As<IAbpOpenIdApplicationStore>().GetFrontChannelLogoutUriAsync(application.As<OpenIddictApplicationModel>(), cancellationToken);
}
public virtual async ValueTask<string> GetClientUriAsync(object application, CancellationToken cancellationToken = default)
{
Check.NotNull(application, nameof(application));

7
modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Applications/AbpOpenIddictApplicationStore.cs

@ -635,6 +635,13 @@ public class AbpOpenIddictApplicationStore : AbpOpenIddictStoreBase<IOpenIddictA
}
}
public virtual async ValueTask<string> GetFrontChannelLogoutUriAsync(OpenIddictApplicationModel application, CancellationToken cancellationToken = default)
{
Check.NotNull(application, nameof(application));
return await new ValueTask<string>(application.FrontChannelLogoutUri);
}
public virtual ValueTask<string> GetClientUriAsync(OpenIddictApplicationModel application, CancellationToken cancellationToken = default)
{
Check.NotNull(application, nameof(application));

2
modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Applications/IAbpOpenIdApplicationStore.cs

@ -6,6 +6,8 @@ namespace Volo.Abp.OpenIddict.Applications;
public interface IAbpOpenIdApplicationStore : IOpenIddictApplicationStore<OpenIddictApplicationModel>
{
ValueTask<string> GetFrontChannelLogoutUriAsync(OpenIddictApplicationModel application, CancellationToken cancellationToken = default);
ValueTask<string> GetClientUriAsync(OpenIddictApplicationModel application, CancellationToken cancellationToken = default);
ValueTask<string> GetLogoUriAsync(OpenIddictApplicationModel application, CancellationToken cancellationToken = default);

9
modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo/Abp/OpenIddict/Applications/OpenIddictApplicationModel.cs

@ -89,13 +89,18 @@ public class OpenIddictApplicationModel : ExtensibleObject
/// </summary>
public virtual string Settings { get; set; }
/// <summary>
/// Gets or sets the front-channel logout URI associated with the application.
/// </summary>
public virtual string FrontChannelLogoutUri { get; set; }
/// <summary>
/// URI to further information about client.
/// </summary>
public string ClientUri { get; set; }
public virtual string ClientUri { get; set; }
/// <summary>
/// URI to client logo.
/// </summary>
public string LogoUri { get; set; }
public virtual string LogoUri { get; set; }
}

Loading…
Cancel
Save