
cntr1 (cntr1) asked a question.
Even after enabling CORS for "http://localhost:3000" I am having CORS error. By the way I am trying to use org authorization.
The error says
"Access to fetch at 'https://{oktaorg}/oauth2/v1/authorize/.well-known/openid-configuration' from origin 'http://localhost:3000' 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. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled"

Hello @cntr1 (cntr1)
Thanks for posting.
The message says that the browser has blocked the request because of a CORS policy. It suggests two solutions. The second suggestion is to change the mode from cors to no-cors in the JavaScript fetch request. This is not an option as the browser always deletes the response data when in no-cors mode to prevent data from being read by an unauthorized client.
The solution to the issue is for the server to set a response header that allows the browser to make cross-domain requests to it.
https://developer.okta.com/blog/2021/08/02/fix-common-problems-cors
Also take a look to this document for more information:
https://stackoverflow.com/questions/54795740/access-to-fetch-at-from-origin-has-been-blocked-by-cors-policy-no-acce
Let us know if this helps you.
Daniela Chavarria.
Okta Inc.