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

Add support for OAuth configuration #595

Closed
drewsilcock opened this issue Jan 2, 2020 · 6 comments
Closed

Add support for OAuth configuration #595

drewsilcock opened this issue Jan 2, 2020 · 6 comments

Comments

@drewsilcock
Copy link

Is your feature request related to a problem? Please describe.
When using OAuth2 security definitions, it is frustrating to always have to put the OAuth information into the Swagger UI modal every time I want to authenticate. Swagger UI provides functionality to include default values for these variables (e.g. clientId, realm, appName) - see here for relevant Swagger UI documentation.

Describe the solution you'd like
In order for implementations using this library and Swagger UI (such as swaggo/echo-swagger, which I'm using), the relevant configuration parameters need to be provided to the Swagger UI JS library. This information could be included by this library using // @clientId my-client in the // @securitydefinitions.oauth2.* comment block (or similar).

Describe alternatives you've considered
This could also be a part only of libraries such as swaggo/echo-swagger that use this library - these are the components that would actually call the initOAuth() function from the Swagger UI library. It makes sense to me to have this information available from this central library, though.

Additional context
You can see how flask-restplus handle this here: https://flask-restplus.readthedocs.io/en/stable/swagger.html#customization and https://github.com/noirbizarre/flask-restplus/blob/master/flask_restplus/templates/swagger-ui.html

@drewsilcock
Copy link
Author

After looking into this some more it might just be easier to let the implementations handle this instead of making the configuration available globally through this library. Anyway, I've got a PR on the echo-swagger repo demonstrating how to implement it for this package:

swaggo/echo-swagger#25

@DeyiXu
Copy link

DeyiXu commented Jun 28, 2020

make

@ubogdan
Copy link
Contributor

ubogdan commented Sep 28, 2021

Not a swag issue. Try to fix the conflicts so we can review and merge it.

@ryjogo
Copy link

ryjogo commented Nov 9, 2021

Hi, was this ever done?

@ubogdan
Copy link
Contributor

ubogdan commented Nov 9, 2021

@ryjogo it's avail since 1.3.3

@ryjogo
Copy link

ryjogo commented Nov 9, 2021

@ubogdan nice, yeah so i'm using 1.3.3 - was client-id implemented too? if so how is one to define?

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

4 participants