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

How to send cookies in request (swagger-ui 3.x) #2895

Closed
HunDunDM opened this issue Apr 11, 2017 · 7 comments · Fixed by #5149
Closed

How to send cookies in request (swagger-ui 3.x) #2895

HunDunDM opened this issue Apr 11, 2017 · 7 comments · Fixed by #5149

Comments

@HunDunDM
Copy link

if set "enableCookies: true" in swagger-ui 2.x, it will send cookies in request.
But it don't work in 3.x.
What should I do?

@webron
Copy link
Contributor

webron commented Apr 12, 2017

At the moment, that configuration is not yet available in 3.x. If you require it, either use 2.x or consider submitting a PR to 3.x to add support for it.

@raarts
Copy link

raarts commented Aug 17, 2017

Just fired it up and having the same problem. But there is an option in the authorize modal to put in a cookie. Am I correct in assuming @HunDunDM had that option too, and it did not work?

Or was that input field in the modal added since then, and it's supposed to work now? Confused.

@HunDunDM
Copy link
Author

still not work now. I am waiting for this PR

@HunDunDM
Copy link
Author

HunDunDM commented Feb 7, 2018

Not a robust solution
currently the latest version(3.9.3)
edit dist/index.html

     layout: "StandaloneLayout"
   })

+  ui.fn.fetch.withCredentials = true
   window.ui = ui

then work fine.

@Phoenix1978
Copy link

  • ui.fn.fetch.withCredentials = true
    --> did not work for me

+1 to add cookie management in Swagger 3... natively

Crazy to have a spec, without proper implementation of it. Without any warning
We choose Swagger to this spec, so maybe it may be useful to change of tool

@sile16
Copy link

sile16 commented Apr 25, 2018

ui.fn.fetch.withCredentials = true

This worked for me. Using Firefox 59.0.2 the CORS Everywhere extension

@DonMartin76
Copy link
Contributor

I am slightly confused regarding what this is supposed to do?

I am looking for a way for Swagger UI to load the Swagger JSON from a CORS location (the thing which is specified via ?url=...), passing the Cookie information when doing that. Is this what it's supposed to do?

If so, it doesn't work in neither Safari nor Chrome (on macOS).

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

Successfully merging a pull request may close this issue.

7 participants