swagger-api / swagger-ui

Swagger UI is a collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.
https://swagger.io
Apache License 2.0
26.48k stars 8.95k forks source link

Authentication with keycloak.js #4628

Open wijdench opened 6 years ago

wijdench commented 6 years ago

Hi, i'm using keycloak to protect swagger document in my backend node app. and i want to use config.js to protect my keycloak configuration on object declared in config file. "keycloak": { "serverUrl": "url", "realm": "realmName", "clientId": "clientId" },

Q&A (please complete the following information)

Content & configuration

in index.html file: ` `

shockey commented 6 years ago

Hi @wijdench - it's not clear what your question is, or how it relates to Swagger UI. Can you elaborate?

wijdench commented 6 years ago

Thank you for your feedback. My question is how can i add configuration in Swagger UI html file using config.js?

shockey commented 6 years ago

I'm sorry, I'm still not following.

Are you saying that you have a configuration file on your server that you'd like to use to control Swagger UI's settings?

wijdench commented 6 years ago

Exactly :)

shockey commented 5 years ago

@wijdench, is this still an issue for you? happy to help if so!

wijdench commented 5 years ago

Hi, Thanks fo you feedback, it still an issue for me.

wijdench commented 5 years ago

how can i call Keycloak config object created in config directoy inside index.html swagger file. Fo now i configure Keycloak Inside index.html. var keycloak = Keycloak({ "realm": "realmName", "url": "url", "clientId": "clientId" });

and i'm using config.js module to centralise all my app configuations. Thanks.