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

Can we change the host and add a generated token by js in the new SwaggerUI? #4308

Closed
LuoPQ opened this issue Mar 9, 2018 · 4 comments
Closed

Comments

@LuoPQ
Copy link

LuoPQ commented Mar 9, 2018

With the swagger 2.0, we can use the following code to set host and add a token, can we do that in swagger 3.0?

window.swaggerUi.api.setHost(host);
window.swaggerUi.api.clientAuthorizations.add("oauth", new SwaggerClient.ApiKeyAuthorization('Authorization', 'Bearer ' + accessToken, 'header'));
@LuoPQ
Copy link
Author

LuoPQ commented Mar 9, 2018

use requestInterceptor can do that, thanks anyway

@LuoPQ LuoPQ closed this as completed Mar 9, 2018
@LuoPQ
Copy link
Author

LuoPQ commented Mar 9, 2018

Is there any better way to do this?

@LuoPQ LuoPQ reopened this Mar 9, 2018
@shockey
Copy link
Contributor

shockey commented Mar 10, 2018

the ApiKeyAuthorization method is a pending feature, in the meantime there are some workarounds in #2915 that you can use! 😄

Closing as a duplicate.

@shockey shockey closed this as completed Mar 10, 2018
@lock
Copy link

lock bot commented Jul 2, 2019

Locking due to inactivity.

This is done to avoid resurrecting old issues and bumping long threads with new, possibly unrelated content.

If you think you're experiencing something similar to what you've found here: please open a new issue, follow the template, and reference this issue in your report.

Thanks!

@lock lock bot locked and limited conversation to collaborators Jul 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants