question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Login reloop issue when using msal-angular wrapper

See original GitHub issue

Core Library

MSAL.js v2 (@azure/msal-browser)

Core Library Version

2.14.1

Wrapper Library

MSAL Angular (@azure/msal-angular)

Wrapper Library Version

2.0.5

Public or Confidential Client?

Public

Description

@jasonnutter Using Angular Wrapper, after sometime when accessing the application, loginRedirect goes into loop then I have to delete cookies to make it work. What’s the trick to make it work. it works fine for the first time. Appreciate your help.

Error Message

No response

Msal Logs

No response

MSAL Configuration

auth: {
      clientId: clientid
      authority: authority,
    
    },
    cache: {
      cacheLocation: BrowserCacheLocation.LocalStorage,
      storeAuthStateInCookie: isIE // set to true for IE 11. Remove this line to use Angular Universal
    },
    system: {
      loggerOptions: {
        loggerCallback,
        logLevel: LogLevel.Info,
        piiLoggingEnabled: false
      }
    }

Relevant Code Snippets

msalService.loginRedirect(singIn)

Reproduction Steps

  1. Logged in with properly user and did not logged out
  2. Logged in after 24 hrs and logging with different user
  3. The Application looping back to multiple time until the user explicitly delete the cookies

Expected Behavior

once user logs in after token expiry then it should navigate to authentication screen and once he logs in the user should be login with new token

Identity Provider

Azure AD / MSA

Browsers Affected (Select all that apply)

Edge

Regression

@azure/msal-browser: “2.19.0”

Source

Internal (Microsoft)

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:35 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
tnorlingcommented, Oct 11, 2022

@bmahall we cannot add the $destory for the service

Why not? Can you also please confirm that you are handling the redirect response as described by @bmahall above? Are you able to reproduce your issue with one of our samples here?

1reaction
supriyaGannvicommented, Sep 8, 2022

@bmahall could u please help how can we resolve this issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

Azure AD infinite login loop with Angular 9 - Stack Overflow
Yes, this is correct. We found the issue - was caused by slot mismatch between client application and our API - the slots...
Read more >
@azure/msal-browser - npm
A vanilla JS sample showing usage of @azure/msal-browser in an application designed to run in Internet Explorer 11. npm start -- -s ie11-sample....
Read more >
Issues on Internet Explorer & Microsoft Edge (MSAL.js)
When users sign in to the application on Microsoft Edge, they are redirected back from the AAD login page and are stuck in...
Read more >
@azure/msal-angularjs - npm Package Health Analysis | Snyk
Angular JS Wrapper for MSAL JS For more information about how to use this package see ... Without the above setting, AAD login...
Read more >
angular msal refresh token | The AI Search Engine You Control
You are in luck I have been through this exact same problem before and it took me weeks to resolve it. To acquire...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found