0

Here is Swagger/OpenAPI definition:

 services.AddOpenApiDocument(document =>
        {
            document.DocumentProcessors.Add(new SecurityDefinitionAppender("Bearer", Enumerable.Empty<string>(),
                new OpenApiSecurityScheme
                {
                    Type = OpenApiSecuritySchemeType.OAuth2,
                    Flow = OpenApiOAuth2Flow.AccessCode,
                    Scopes = new Dictionary<string, string> {{"myScope", "myScope"}},
                    AuthorizationUrl = "redacted",
                    TokenUrl = "redacted"
                }));
        }); 

and Swagger-UI configuration options:

app.UseSwaggerUi3(settings =>
        {
            settings.OAuth2Client = new OAuth2ClientSettings
            {
                ClientId = "MyClientID",
                ClientSecret = string.Empty,
                AppName = "My App",
                UsePkceWithAuthorizationCodeGrant = true
            };
        });

I want that scope should be checked by default, Is this possible?

enter image description here

user584018
  • 10,186
  • 15
  • 74
  • 160

1 Answers1

1

You can do it in version 6.0 by OAuthScopes method.

enter image description here

Reference: https://github.com/abpframework/abp/pull/7740

Mohammad Roshani
  • 486
  • 7
  • 19