Connecting to Okta

I have a problem with connecting to Okta from Angular http://localhost:4200 has been blocked by CORS policy:
I added it to the application URLs but I still have this problem, should I add it to trusted origin?

1 Like

Hi @michaelides CORS is very common error. Please note that as mentioned here : Overview | Okta Developer every website origin has to be mandatorily be permitted/added as a trusted origin first to pass through the CORS mechanism :blush:

1 Like

Thanks @monishb , where in the admin dashboard can I add as a trusted origin?

Hey @michaelides please find the steps here to add a trusted origin: Grant cross-origin access to websites | Okta Developer

To sum it up:

  1. Select Security and then API .
  2. Select the Trusted Origins tab.
  3. Select Add Origin and then enter a name for the organization origin.
  4. In the Origin URL box, specify the base URL of the website that you want to allow cross-origin requests from.
  5. Make sure that CORS is selected as the Type . You can also enable the Redirect setting, which allows for redirection to this Trusted Origin after a user signs in or out.
  6. Click Save .

Amazing. Thanks Monish. :smiley:

1 Like

@Powlowski please what’s the relationship with MyCCPay ?

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.