swagger-ui icon indicating copy to clipboard operation
swagger-ui copied to clipboard

Swagger ui - send authentication key as query parameter to base url

Open sujithktkm opened this issue 11 years ago • 2 comments

How to pass base url in the form http://127.0.0.1:3000/resources/swagger.json?key=aslkdajd1323121lklakskdl to swagger ui ?

I was able to access http://127.0.0.1:3000/resources/swagger.json but when I add auth filter and pass key, it says, Unauthorized.

Using swagger 1.5

Pre-populating the parameter through apiKeyauthorization in index.html did not help, but when I type in the text box (the one that has 'api_key' holder) in UI, it worked. Unable to understand the reason for this. Hope someone can help me make sense out of it.

Also help me find swagger.json file!

sujithktkm avatar Jun 25 '15 23:06 sujithktkm

Please follow https://github.com/swagger-api/swagger-ui/issues/1414.

webron avatar Jul 05 '15 09:07 webron

@webron , how to we pass the same thing in latest swagger ui , i guess it is v3+.

https://stackoverflow.com/questions/49050969/setting-swagger-apikey-in-version-2-0

shatestest avatar Mar 02 '18 07:03 shatestest