-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Comments
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: |
make |
Not a swag issue. Try to fix the conflicts so we can review and merge it. |
Hi, was this ever done? |
@ryjogo it's avail since 1.3.3 |
@ubogdan nice, yeah so i'm using 1.3.3 - was client-id implemented too? if so how is one to define? |
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
The text was updated successfully, but these errors were encountered: