I hope you’re doing well. I am currently encountering an issue with CORS (Cross-Origin Resource Sharing) for some of my APIs on the API Gateway. Specifically, I am facing a CORS issue for the AccessToken endpoint at https://xyz.com/invoke/pub.apigateway.oauth2/getAccessToken.
I would appreciate any advice or guidance on how to fix this CORS issue for the AccessToken endpoint. Any insights on this matter would be greatly appreciated. Thank you in advance for your assistance.
Access to XMLHttpRequest at: ‘url to API’ from origin ‘from where requrest is started’ has been blocked by CORS policy: Response to preflight request doesnt pass access control check No ‘Access-Control-Allow-Origin’ header is present on the requested resource.
Note:Wrapper API will be pass-through API only where it simply takes JSON request payload and pass on to native endpoint and will return native’s response back to consumer.
Ask API consumers to invoke wrapper API instead of builtin getAccessToken endpoint. Hopefully this will solve CORS error you are currently seeing in case of built-in getAccessToken endpoint.
I have the samen issue. And maybe a wrapper API will be a solution. I would like to have a fix so I can add the right CORS headers to the oauth getAccessToken endpoint.