Skip to content
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

How to hide client secret in Swagger Ul for Auth2 client? #10152

Open
skiddow123 opened this issue Sep 30, 2024 · 2 comments
Open

How to hide client secret in Swagger Ul for Auth2 client? #10152

skiddow123 opened this issue Sep 30, 2024 · 2 comments

Comments

@skiddow123
Copy link

I'm configuring Swagger UI as an OAuth2 client in my Spring application. I see that I'm required to set the client secret using the property: springdoc.swagger-ui.oauth.client_id=secret. However, I want to know if there is a way to hide or protect the client secret in the Swagger UI. Is there a recommended approach to achieve this while still allowing users to authenticate through OAuth2?
I already created an issue springdoc/springdoc-openapi#2737 on the springdoc repo and I was directed here

@nedcerneckis
Copy link

Would be nice to have the option to hide this. We use a springdoc generator in Java using OIDC PKCE flow and client secret is useless for us. Only confuses the user

@heldersepu
Copy link
Contributor

heldersepu commented Oct 11, 2024

Are you trying to hardcode secrets in the Swagger UI ?!?
that is a bad idea, the end user should enter that, not have it hardcoded...

https://petstore.swagger.io/
image

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

No branches or pull requests

3 participants