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

Pre-populating OAuth Client ID #438

Closed
jfach opened this issue Jun 26, 2021 · 3 comments
Closed

Pre-populating OAuth Client ID #438

jfach opened this issue Jun 26, 2021 · 3 comments

Comments

@jfach
Copy link
Contributor

jfach commented Jun 26, 2021

Is it possible to pre-populate the OAuth Client ID when clicking the Authorize button?

In DRF YASG, I'm able to accomplish this by specifying the following configuration in the SWAGGER_SETTINGS dict:

"OAUTH2_CONFIG": {"clientId": "my_client_id_here"}

Is there a way to do this with DRF Spectacular?

tfranzel added a commit that referenced this issue Jun 26, 2021
@tfranzel
Copy link
Owner

hi! i added the config SWAGGER_UI_OAUTH2_CONFIG for this. it should work as with yasg. could you test this on master? thanks.

jfach added a commit to jfach/drf-spectacular that referenced this issue Jun 28, 2021
Changed `ouath2_config` -> `oauth2_config`
@jfach
Copy link
Contributor Author

jfach commented Jun 28, 2021

Hi @tfranzel ! I really appreciate the speedy resolution to this issue, thank you! I just tested it out and it works perfectly, there was a little typo in the swagger_ui.js file when performing a check to see if oauth2 settings were provided. I have submitted this in a PR.

Thanks again for your help!

@tfranzel
Copy link
Owner

you're welcome. glad it worked out. thanks for fixing that typo! it will be part of the next release, however that might take a moment as i usually wait for 2-3 things to pool before doing a release. just so you know.

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

2 participants