question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for CORS with credentials

See original GitHub issue

When Swagger API is authenticated through cookie, Swagger GUI running on different host cannot access it because it doesn’t pass on cookie. Swagger JS should be setting flag withCredentials to true to enable browser to pass on cookie to the Swagger API.

Example of enabling this for jQuery: $.ajax({ url: a_cross_domain_url, xhrFields: { withCredentials: true } });

References:

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
jhilarycommented, May 11, 2017

Now you can enable withCredentials by passing enableCookies=true to SwaggerClient. https://github.com/swagger-api/swagger-js/pull/891 new Swagger({ url: a_cross_domain_url, enableCookies: true });

0reactions
shockeycommented, Aug 11, 2018

@LiorArbel @DonMartin76, take a look at https://github.com/swagger-api/swagger-js/pull/1189 - it may cover your use case 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

Access-Control-Allow-Credentials - HTTP - MDN Web Docs
The Access-Control-Allow-Credentials response header tells browsers whether to expose the response to the frontend JavaScript code when the ...
Read more >
What exactly does the Access-Control-Allow-Credentials ...
I'm trying to understand how to use CORS and am confused about what the Access-Control-Allow ...
Read more >
Include credentials on cross-origin requests
Go to Site, CORS and click default to select the Allow Credentials check box. For example: When you access http://sxa from http://fake ,...
Read more >
How do I send a CORS request with Credentials? - ReqBin
To send a CORS request with credentials, you must provide an Origin request HTTP header and an authorization cookie. CORS (Cross-Origin ...
Read more >
Top Five CORS Issues You Don't Want To Run Into
Access Control Allow Origin header in response must not be wildcard * ... Well the problem is, if you're sending some credentials like...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found