Closed
Description
Describe the bug
I'm using SpringBoot 2.2 and trying to migrate from springfox 2.9.2 to springdoc-openapi. We use OAuth2 security Scheme. I'm trying to setup swagger ui to be able to go through implicit login flow.
But "client_id" property on auth dialog is empty and I need it filled with correct clientId.
My code to setup OpenAPI:
@Bean
public OpenAPI customOpenAPI() {
String authorizeUrl = String.format(
"https://login.microsoftonline.com/%s/oauth2/v2.0/authorize", tenantId);
Scopes scopes = new Scopes();
scopes.addString(apiScope, "Access API");
OAuthFlow oAuthFlow = new OAuthFlow();
oAuthFlow.authorizationUrl(authorizeUrl);
oAuthFlow.setScopes(scopes);
return new OpenAPI()
.components(
new Components()
.addSecuritySchemes("oauth", new SecurityScheme()
.type(Type.OAUTH2)
.in(In.HEADER)
.bearerFormat("jwt")
.flows(
new OAuthFlows().implicit(oAuthFlow)
)
)));
}
My application.pproperties
springdoc.swagger-ui.oauth.clientId=some client id
springdoc.swagger-ui.oauth.clientSecret=some client secret
Expected result
field "client_id" is populated with springdoc.swagger-ui.oauth.clientId value
Metadata
Metadata
Assignees
Labels
No labels