Hello
I am new here but have been struggling with a problem on swagger.
I am getting a Fetch error when I try and authorise using oauth2 with authorisation code flow.
The problem is with CORS and because when using swagger the Origin header is not being set.
My question is fairly simple but I can not find the answer anywhere.
Where/how can I set the request headers for the authorise call in swagger ui?
KR,
James Hudson
Hi
In your case I might suggest you 2 solutions:
Access-Control-Allow-Origin: https://app.swaggerhub.com Vary: Origin
Since you are sending request from SwaggerHub, the origin value is https://app.swaggerhub.com
If you are expecting a request from any origin while using a wildcard in the response header, you should disable credentials on SwaggerHub OpenAPI editor page (check the bottom settings in the previous screenshot).
Also, I would like to recommend you the this article on CORS to get into SwaggerHub.
Subject | Author | Latest Post |
---|---|---|