Skip to content

GET OIDC client credentials from the Server where SwaggerUI is hosted. #7270

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

Open
BANSAL-PALLAVI opened this issue May 15, 2021 · 3 comments · May be fixed by #10387
Open

GET OIDC client credentials from the Server where SwaggerUI is hosted. #7270

BANSAL-PALLAVI opened this issue May 15, 2021 · 3 comments · May be fixed by #10387

Comments

@BANSAL-PALLAVI
Copy link

  • OS: All
  • Browser: Firefox
  • Method of installation: dist package
  • Swagger-UI version: 3.37.1
  • Swagger/OpenAPI version: OpenAPI 3.0

Query is regarding using OIDC in Swagger UI. Swagger UI is hosted on Liberty server. The server has oidcClient configured and a REST API gives all the information regrading client credentials, redirect url etc. With the current implementation it seems that it takes the discovery url and the user is supposed to enter the credentials. But it might not be known to all the users. What I need is that Swagger UI takes the credentials from the server and then redirects directly to the login page of OIDC. Can anyone please help with this?

@trickert76
Copy link

Is this secured? Should there be a "service" that exposes the client secret of a OIDC client. It is called secret and the Swagger UI is Javascript and runs inside the users scope where the client secret should not be known to the user. Also the ability to load a secret from a server - this would be a public reachable URL and so everybody can read the content.

In other words - the Swagger UI is a separate "public" client in the OIDC realm which doesn't need a secret.

@Mathias02
Copy link

Mathias02 commented Mar 24, 2025

[BANSAL-PALLAVI]: It's been a while for this Pull Request. If I understand is that the user credentials exposed with the current implementation?

@trickert76
Copy link

It's bad practice to store client credentials in the HTML/JS page and expose it to any user that can reach that page. For dev environments maybe ok, but not in general. I would expect something like a public client config (which doesnt require a secret) that uses allowed redirects on OIDC service side. There are many examples out there, like https://www.keycloak.org/securing-apps/javascript-adapter. The line 42 with clientSecret is marked as optional, but I would just remove it and then it's ok.

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