Browse Source
Merge pull request #17336 from abpframework/gterdem/swagger_oidc_update
pull/17341/head
liangshiwei
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
12 additions and
2 deletions
-
framework/src/Volo.Abp.Swashbuckle/Microsoft/Extensions/DependencyInjection/AbpSwaggerGenServiceCollectionExtensions.cs
-
framework/src/Volo.Abp.Swashbuckle/Volo/Abp/Swashbuckle/AbpSwaggerOidcFlows.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 => |
|
|
|
{ |
|
|
|
|
|
|
|
@ -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"; |
|
|
|
} |