<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
0D54z0000AE7LAnCQNOkta Classic EngineAuthenticationAnswered2024-08-29T16:09:33.000Z2024-08-28T15:10:37.000Z2024-08-29T16:09:33.000Z
CORS error while calling Authorize API endpoint from Angular

We are trying to implement the authentication and authorization using OKTA API. Our application was built on SPA model using Angular as frontend and .NET core WEB API as backend. While trying to make a call from Angular frontend application to the authorize Api endpoint, we are getting the CORS error. Please see the screenshot below.

/help/servlet/rtaImage?refid=0EM4z000007IjvS

The application URL is already registered in the trusted origins in Okta server.

/help/servlet/rtaImage?refid=0EM4z000007IjvX

The application we are trying to use is registered as a SPA in the Okta server.

Okta Server Settings

/help/servlet/rtaImage?refid=0EM4z000007Ijvc

/help/servlet/rtaImage?refid=0EM4z000007Ijvh

API Query

https://dev-17261609.okta.com/oauth2/default/v1/authorize?response_type=code&client_id=0oa8xxxxxl9bOuh125d7&state=TestingGSDWXSPA&redirect_uri=http://localhost:4200/login/callback&scope=openid%2520profile%2520email%2520offline_access&code_challenge_method=S256&code_challenge=qjrzSW9gMiUgpUvqgEPE4_-8swvyCtfOVvg55o5S_es

 

Code snippet for calling API

/help/servlet/rtaImage?refid=0EM4z000007Ijvm

Can you please help to fix the above mentioned CORS error ?


This question is closed.
Loading
CORS error while calling Authorize API endpoint from Angular