-
Notifications
You must be signed in to change notification settings - Fork 9k
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
api_key not send as header param when pressing Explore button #1243
Comments
Yup, this is a known issue (#1160). It's currently fixed in the develop_2.0 branch, so please give it a try. |
After trying it with See the (missing) headers sent by swagger-ui (no credentials are included): Call:
Response:
Calling it direcly with credentials on query |
We have the same problem either using |
Hi, I've been through this several times and I don't believe there is an issue with keys being set. Can you please share your swagger spec? |
Sure Tony. The spec is here: Thanks |
OK, here's the issue. You have keys like this:
Note the security array is empty. That means, per the swagger spec, that "no security is required" and therefore the UI will not pass any headers. You have two options.
|
Thanks Toni. I will test & fix my side it asap. |
Tested and working. Thanks! |
Great news. We're going to work on some better documentation for this. |
The latest sources of swagger-ui I was not able to send the api_key using the UI as header param.
Repro sample:
Using http://petstore.swagger.io/ point to: https://model-101.herokuapp.com/api/swagger.json using apikey =
icinetic
does not sends credentials -> 401.Server accepts it via header, cookie or query param string.
Using the following one makes the trick but without using
api_key
header:Using http://petstore.swagger.io/ point to: https://model-101.herokuapp.com/api/swagger.json?api_key=icinetic using apikey = `` works -> 200.
Tested with petstore.swagger.io and a local enviroment with the latest sources.
Is is a bug or I am missing something? Thxz.
The text was updated successfully, but these errors were encountered: