# I encountered a CORS error when attempting to call the token/authorize API in Angular, even after adding it to the trusted origin. However, the login functionality is working properly

**URL:** <https://devforum.okta.com/t/i-encountered-a-cors-error-when-attempting-to-call-the-token-authorize-api-in-angular-even-after-adding-it-to-the-trusted-origin-however-the-login-functionality-is-working-properly/24318>\
**Category:** OAuth/OIDC\
**Tags:** angular\
**Created:** [May 20, 2023, 3:51am UTC](https://devforum.okta.com/t/i-encountered-a-cors-error-when-attempting-to-call-the-token-authorize-api-in-angular-even-after-adding-it-to-the-trusted-origin-however-the-login-functionality-is-working-properly/24318 "2023-05-20T03:51:52Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Sherry](https://avatars.discourse-cdn.com/v4/letter/s/7cd45c/32.png) [@Sherry](https://devforum.okta.com/u/Sherry)\
**Post date:** [May 31, 2023, 4:24pm UTC](https://devforum.okta.com/t/i-encountered-a-cors-error-when-attempting-to-call-the-token-authorize-api-in-angular-even-after-adding-it-to-the-trusted-origin-however-the-login-functionality-is-working-properly/24318/4 "2023-05-31T16:24:38Z")

</div>

Are you doing a redirect or AJAX calls to the /authorize?

> [@CORS error with /v1/authorize](https://devforum.okta.com/t/cors-error-with-v1-authorize/14546):
>
> Why am I getting a CORS error calling the /v1/authorize end point when I have added localhost to Trusted Origins? I only seem to be able to get this to work when I put the URL together with query params and call it directly in the browser. const result = await axios({ method: "Post", headers: { 'Content-Type': 'text/plain', 'Access-Control-Allow-Origin': '\*' }, url: 'https://dev-123456.okta.com/oauth2/v1/authorize', data: { clie…

[Okta - the /authorize endoint blocked by CORS](https://devforum.okta.com/t/okta-the-authorize-endoint-blocked-by-cors/20648) [CORS error on Okta authorize api end point from frontend - #3 by rahul.garg](https://devforum.okta.com/t/cors-error-on-okta-authorize-api-end-point-from-frontend/20449/3)

---

_[View the full topic](https://devforum.okta.com/t/i-encountered-a-cors-error-when-attempting-to-call-the-token-authorize-api-in-angular-even-after-adding-it-to-the-trusted-origin-however-the-login-functionality-is-working-properly/24318)._
