0
votes

I have a browser application that calls WSO2 API Manager JWT Grant endpoint to exchange a JWT for an access token.

The endpoint invoked from Javascript is https://WSO2APIM/oauth2/token

The problem is this call is blocked by the browser because of the CORS restriction:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://WSO2APIM/oauth2/token/. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing)

How can I configure the CORS permission for this endpoint?

.

1

1 Answers

1
votes

You could enable cors by adding cors hanlder to the token endpoint

org.wso2.carbon.apimgt.gateway.handlers.security.CORSRequestHandler

See https://stackoverflow.com/a/35306629/1110305