-
Notifications
You must be signed in to change notification settings - Fork 751
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
Support for CORS with credentials #251
Comments
While this is easily added, it will cause other issues under some circumstances. @q7a I do not think we can determine automatically whether or not to pass |
I've been getting around this with
along with perhaps letting useJQuery take a function that takes the jquery object, to set ajaxtransport or ajaxprefiter would solve this and give some room for other similar use cases. E.g.
|
Since you can supply your own HTTP transports now (see https://github.com/swagger-api/swagger-js/blob/master/test/client.js#L308-L325), you can easily support this, and without hacking the swagger-js code. |
Solution provided by jackphel does not seem to work for me. |
@blop more details? |
Now you can enable withCredentials by passing enableCookies=true to SwaggerClient. |
Is there a way currently (v3) to enable cookies/credentials? I really really need this |
I would also like to see this, at least as an option. This would take away the need for some really nasty workarounds I have in our API Management system. |
@LiorArbel @DonMartin76, take a look at #1189 - it may cover your use case 😄 |
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
totrue
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:
The text was updated successfully, but these errors were encountered: