Browse Source

Added oidc flows and updated discovery endpoint

pull/17336/head
Galip Tolga Erdem 3 years ago
parent
commit
d2f24b4126
  1. 5
      framework/src/Volo.Abp.Swashbuckle/Microsoft/Extensions/DependencyInjection/AbpSwaggerGenServiceCollectionExtensions.cs
  2. 9
      framework/src/Volo.Abp.Swashbuckle/Volo/Abp/Swashbuckle/AbpOidcFlows.cs

5
framework/src/Volo.Abp.Swashbuckle/Microsoft/Extensions/DependencyInjection/AbpSwaggerGenServiceCollectionExtensions.cs

@ -5,6 +5,7 @@ using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;
using Swashbuckle.AspNetCore.SwaggerUI;
using Volo.Abp.Content;
using Volo.Abp.Swashbuckle;
namespace Microsoft.Extensions.DependencyInjection;
@ -88,10 +89,10 @@ public static class AbpSwaggerGenServiceCollectionExtensions
Action<SwaggerGenOptions>? setupAction = null)
{
var discoveryUrl = discoveryEndpoint != null ?
new Uri(discoveryEndpoint) :
new Uri($"{discoveryEndpoint.TrimEnd('/')}/.well-known/openid-configuration") :
new Uri($"{authority.TrimEnd('/')}/.well-known/openid-configuration");
flows ??= new [] { "authorization_code" };
flows ??= new [] { AbpSwaggerOidcFlows.AuthorizationCode };
services.Configure<SwaggerUIOptions>(swaggerUiOptions =>
{

9
framework/src/Volo.Abp.Swashbuckle/Volo/Abp/Swashbuckle/AbpOidcFlows.cs

@ -0,0 +1,9 @@
namespace Volo.Abp.Swashbuckle;
public static class AbpSwaggerOidcFlows
{
public const string AuthorizationCode = "authorization_code";
public const string Implicit = "implicit";
public const string Password = "password";
public const string ClientCredentials = "client_credentials";
}
Loading…
Cancel
Save