1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

MSAL loginPopup() inside an iframe creates and deletes cookies immediately on first login...

Discussão em 'Angular' iniciado por Oihane, Setembro 16, 2024.

  1. Oihane

    Oihane Guest

    I'm working on an Angular application that uses MSAL for authentication. The login flow works perfectly when using this.authService.loginRedirect() or this.authService.loginPopup() in our production environment.

    However, I've encountered an issue when embedding the application in an iframe and using loginPopup() for authentication. Here's what's happening:

    On the first login attempt inside the iframe, the loginPopup() successfully triggers, I can see a log in the result, and it seems like the authentication completes (cookies are created, etc.). Immediately after, the page auto-refreshes, and I notice that the cookies get created and then immediately deleted. When I trigger loginPopup() again right after this, the login works as expected and completes without issues. I have no issues when the application is not inside an iframe, so I assume this is related to the iframe environment.

    Has anyone faced a similar problem or have suggestions on what could be causing the cookies to be deleted right after being created on the first login attempt inside the iframe?

    "@azure/msal-angular": "^2.0.0-beta.3", "@azure/msal-browser": "^2.13.1", "@angular/cli": "^14.2.12"

    Continue reading...

Compartilhe esta Página