mirror of
https://github.com/nsnail/IGeekFan.AspNetCore.Knife4jUI.git
synced 2025-08-02 23:37:58 +08:00
update 0.0.14
This commit is contained in:
@ -16,14 +16,16 @@ namespace OAuth2Integration.AuthServer
|
||||
RedirectUris = new[] {
|
||||
"http://localhost:55202/resource-server/swagger/oauth2-redirect.html", // IIS Express
|
||||
"http://localhost:5000/resource-server/swagger/oauth2-redirect.html", // Kestrel
|
||||
"http://localhost:5000/oauth/oauth2.html", // Kestrel
|
||||
"http://localhost:8080/oauth/oauth2.html", // Kestrel
|
||||
},
|
||||
|
||||
ClientSecrets = { new Secret("test-secret".Sha256()) },
|
||||
RequireConsent = true,
|
||||
|
||||
AllowedGrantTypes = GrantTypes.Code,
|
||||
RequirePkce = true,
|
||||
AllowedScopes = new[] { "readAccess", "writeAccess" },
|
||||
RequirePkce = false,
|
||||
//AllowedScopes = new[] { "readAccess", "writeAccess" },
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="IdentityServer4" Version="4.1.2" />
|
||||
<PackageReference Include="IdentityServer4" Version="3.0.1" />
|
||||
<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="3.0.1" />
|
||||
<PackageReference Include="NCaptcha.AspNetCore.SessionImages" Version="0.1.0" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.Swagger" Version="6.4.0" />
|
||||
|
@ -60,24 +60,24 @@ namespace OAuth2Integration
|
||||
{
|
||||
c.SwaggerDoc("v1", new OpenApiInfo { Version = "v1", Title = "Test API V1" });
|
||||
|
||||
// Define the OAuth2.0 scheme that's in use (i.e. Implicit Flow)
|
||||
c.AddSecurityDefinition("oauth2", new OpenApiSecurityScheme
|
||||
{
|
||||
Type = SecuritySchemeType.OAuth2,
|
||||
Flows = new OpenApiOAuthFlows
|
||||
{
|
||||
AuthorizationCode = new OpenApiOAuthFlow
|
||||
{
|
||||
AuthorizationUrl = new Uri("/auth-server/connect/authorize", UriKind.Relative),
|
||||
TokenUrl = new Uri("/auth-server/connect/token", UriKind.Relative),
|
||||
Scopes = new Dictionary<string, string>
|
||||
{
|
||||
{ "readAccess", "Access read operations" },
|
||||
{ "writeAccess", "Access write operations" }
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
//// Define the OAuth2.0 scheme that's in use (i.e. Implicit Flow)
|
||||
//c.AddSecurityDefinition("oauth2", new OpenApiSecurityScheme
|
||||
//{
|
||||
// Type = SecuritySchemeType.OAuth2,
|
||||
// Flows = new OpenApiOAuthFlows
|
||||
// {
|
||||
// AuthorizationCode = new OpenApiOAuthFlow
|
||||
// {
|
||||
// AuthorizationUrl = new Uri("/auth-server/connect/authorize", UriKind.Relative),
|
||||
// TokenUrl = new Uri("/auth-server/connect/token", UriKind.Relative),
|
||||
// Scopes = new Dictionary<string, string>
|
||||
// {
|
||||
// { "readAccess", "Access read operations" },
|
||||
// { "writeAccess", "Access write operations" }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//});
|
||||
|
||||
c.CustomOperationIds(apiDesc =>
|
||||
{
|
||||
|
Reference in New Issue
Block a user