<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
0D54z00009Oe1zxCABOkta Classic EngineIntegrationsAnswered2024-07-31T09:02:25.000Z2023-06-30T10:59:45.000Z2023-06-30T23:32:01.000Z

le4n4 (le4n4) asked a question.

cors error while accessing from frontend in oAuth0 by okta

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

Image is not available

 

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 ?

 

 


le4n4 likes this.
This question is closed.
Loading
cors error while accessing from frontend in oAuth0 by okta