Angular application facing CORS issue with AUTH0 API integration

Discussão em 'Angular' iniciado por Abhishek Jadhav, Dezembro 16, 2024.

  1. In my Angular app I have integrated the login feature using Auth0. I am able to see the OKTA login popup and able to to signin using google login option in the popup. It also shows me the access_token and id_token in response after successful login. However, I see the error message - “Cross-Origin-Opener-Policy policy would block the window.close call.”

    [​IMG]

    [​IMG]

    I have added my angular app as allowed origin in CORS section of application settings in Auth0. Also I did some research for CORS on Auth0 website and they suggested that since some browsers block 3rd-party cookies, so the below code (below pasted screenshot) should fix the issue:

    [​IMG]

    After adding the above code in my index.html of my angular app, I am getting a different error now shown in below pasted screenshot:

    [​IMG]

    Uncaught SyntaxError: Failed to execute ‘postMessage’ on ‘Window’: Invalid target origin ‘undefined’ in a call to ‘postMessage’. at CrossOriginAuthentication.callback (cross-origin-authentication.js:155:20) at WebAuth.crossOriginVerification

    Please advise and help, I am struggling. Also there is not much answers on the web as the community is very small with regards to Auth0 knowledge.

    Please let me know if you need any more details regarding my code.

    Many thanks, Abhishek M Jadhav

    Continue reading...

Compartilhe esta Página