Browse Source

Merge pull request #17336 from abpframework/gterdem/swagger_oidc_update

pull/17341/head
liangshiwei 3 years ago
committed by GitHub
parent
commit
04cb7fe2e1
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      framework/src/Volo.Abp.Swashbuckle/Microsoft/Extensions/DependencyInjection/AbpSwaggerGenServiceCollectionExtensions.cs
  2. 9
      framework/src/Volo.Abp.Swashbuckle/Volo/Abp/Swashbuckle/AbpSwaggerOidcFlows.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/AbpSwaggerOidcFlows.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