Skip to content

Set default clientId in springdoc #333

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
artemmysikigorevich opened this issue Jan 9, 2020 · 5 comments
Closed

Set default clientId in springdoc #333

artemmysikigorevich opened this issue Jan 9, 2020 · 5 comments
Labels
enhancement New feature or request

Comments

@artemmysikigorevich
Copy link

Hi!
I migrate from springfox-swagger2 library
and cant set default clientId when create OAuthFlows.
When use springfox-swagger2
I decided it like this

@bean
public SecurityConfiguration security() {
return SecurityConfigurationBuilder.builder()
.clientId("myClientIdForTest")
.clientSecret("myClientIdSecretForTest")
.build();
}

(https://github.com/springfox/springfox/blob/master/springfox-swagger-common/src/main/java/springfox/documentation/swagger/web/SecurityConfiguration.java)

image

How to set default clientId in springdoc?

@bnasslahsen
Copy link
Collaborator

Hi @artemmysikigorevich,

Unfortunately, there is no standard swagger-ui configuration property, but we will propose an enhancement to handle it:

We will need to rely on calling the initOAuth method, which is packaged inside the swagger-ui webjars and we haven't planned to embed custom swagger-ui, as used in springfox.

With the next release 1.2.27, you will be able, to use the custom swagger-ui oauth properties, and using the following prefix springdoc.swagger-ui.oauth:

springdoc.swagger-ui.oauth.clientId=myClientId
springdoc.swagger-ui.oauth.clientSecret=clientSecret

@rycee
Copy link

rycee commented Mar 12, 2020

@bnasslahsen I'm using springdoc-openapi-webflux-ui and this change does not appear to be present in that module. Am I mistaken? If not then I can create an issue for adding it to springdoc-openapi-webflux-ui.

@bnasslahsen
Copy link
Collaborator

@rycee,

This feature has only been added for web-mvc.
It will be added for web-flux for the next release: v1.2.34.

@rycee
Copy link

rycee commented Mar 14, 2020

@bnasslahsen Ah, excellent. Thank you very much!

@bnasslahsen bnasslahsen added the enhancement New feature or request label Jan 10, 2022
@tomgrowflow
Copy link

is there something similar for basic auth and username/password?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants