-
-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #220 from skoruba/release/2.2.0
Release/2.2.2
- Loading branch information
Showing
574 changed files
with
29,243 additions
and
7,665 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
src/Skoruba.Duende.IdentityServer.Admin.Api/Configuration/StartupHelpers.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
using System.Collections.Generic; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using NSwag; | ||
using NSwag.Generation.Processors.Security; | ||
using Skoruba.Duende.IdentityServer.Admin.UI.Api.Configuration; | ||
using Skoruba.Duende.IdentityServer.Admin.UI.Api.Configuration.Authorization; | ||
|
||
namespace Skoruba.Duende.IdentityServer.Admin.Api.Configuration; | ||
|
||
public static class StartupHelpers | ||
{ | ||
public static void AddSwaggerServices(this IServiceCollection services, AdminApiConfiguration adminApiConfiguration) | ||
{ | ||
services.AddEndpointsApiExplorer(); | ||
services.AddOpenApiDocument(configure => | ||
{ | ||
configure.Title = adminApiConfiguration.ApiName; | ||
configure.Version = adminApiConfiguration.ApiVersion; | ||
configure.AddSecurity("OAuth2", new OpenApiSecurityScheme | ||
{ | ||
Type = OpenApiSecuritySchemeType.OAuth2, | ||
Flows = new OpenApiOAuthFlows | ||
{ | ||
AuthorizationCode = new OpenApiOAuthFlow | ||
{ | ||
AuthorizationUrl = $"{adminApiConfiguration.IdentityServerBaseUrl}/connect/authorize", | ||
TokenUrl = $"{adminApiConfiguration.IdentityServerBaseUrl}/connect/token", | ||
Scopes = new Dictionary<string, string> | ||
{ | ||
{ adminApiConfiguration.OidcApiName, adminApiConfiguration.ApiName } | ||
} | ||
} | ||
} | ||
}); | ||
configure.OperationProcessors.Add(new AspNetCoreOperationSecurityScopeProcessor("OAuth2")); | ||
configure.OperationProcessors.Add(new AuthorizeCheckOperationProcessor(adminApiConfiguration)); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.