Hi I call api userinfo from ionic 4 app and I received this message:
Access to XMLHttpRequest at ‘https://dev-…okta.com/userinfo’ from origin ‘http://localhost:8100’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.
A couple of potential issues,
In the Admin console you setup this URL for both Redirect and CORS, not just redirect?
I don’t know if the URL you typed is a typo but there is no endpoint /userinfo directly off of the domain. See here.
Will either be,
You might want to check the issuer (“iss”) value in your access token. That will determine what the url for the /userinfo endpoint will be.
For example, if your issuer is https://dev-123.okta.com/oauth2/default then you would just append /v1/userinfo to it to get https://dev-123.okta.com/oauth2/default/v1/userinfo.