
le4n4 (le4n4) asked a question.
I am developing an java web app and i have integrated oAuth0 by okta in my app.
while testing this app if i make request from front end (javascript fetch request (GET)) then it gives cors error:
Access to fetch at 'https://mydomain.us.auth0.com/authorize?redirect_uri=http://localhost:8081/example_Project/auth2/okta/callback&client_id=pyeAVZPUXIrUp87Ypk&scope=openid&response_type=code&state=1W16FA=Tr7IZuW_nvPY5r3ljbjUK8' (redirected from 'http://localhost:8081/example_Project/auth2/okta') from origin 'http://localhost:8081' has been blocked by CORS policy: 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.
But if i make request directly from browser url bar then it is working fine.
i have enabled cors for http://localhost:8081 from oAuth0 dashboard but it is still giving this error
I also have tried making request with mode : 'no-cors' (javascript fetch) but it is giving 'opaque' type response so that i can't read payload from response.
How to solve this problem ?

Hello @le4n4 (le4n4) Thank you for reacting out to our Community!
Please see the article below that might provide a resolution to your issue:
https://community.auth0.com/t/no-access-control-allow-origin-header-issue/40467/28
We would also recommend to reach out to oAuth0 Support, for additional assistance on this matter.
Community members help others by clicking Like or Select as Best on responses. Try it today.
Coming soon: Get tips from community managers during Okta Community's first Ask Me Anything event on 6/22