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.

Infinite loop with already authenticated users

See original GitHub issue

the first time that an authenticated user (in azure ad) access my site, it will go through an infinite loop during the microsoft login, but the site will work fine if the user get in with an incognito tab.

If the user will be disconnected he will be able to access the site without the incognito tab e then it will work without problem.

My index.js:

ReactDOM.render(<AzureAD provider={authProvider} forceLogin={true}>
    {({login, logout, authenticationState, error, accountInfo})=>{
      if (authenticationState === AuthenticationState.Authenticated){
        return (<App logout={logout} accountInfo={accountInfo && accountInfo.account.userName}/>)
      }else if (authenticationState === AuthenticationState.Unauthenticated){
        if (error) {
          return (
              <p>
                <span>An error occured during authentication, please try again!</span>
                <button onClick={login}>Login</button>
              </p>
            );
        }
        return (
          <p>
          </p>
        );
      }

   }}
  </AzureAD>, document.getElementById('root'));

config: cache: { cacheLocation: "localStorage", storeAuthStateInCookie: true }

Any suggestion to discover the issue?

Is it a mine issue or it could be a bug?

Thanks

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
AndrewCraswellcommented, Dec 10, 2019

These issues should have been addressed in the latest release of the library. There are some breaking changes which is why there was a major release update, and a number of follow up hot fixes applied. I’m closing this issue for now, but please let me know if you encounter any questions when upgrading.

Unfortunately these changes were rushed much faster than I would have liked due to immediate needs from multiple teams.

2reactions
AndrewCraswellcommented, Nov 26, 2019

I do see an issue in our library code where if an error occurs during login (and forceLogin=true) the error is ignored and this can cause an infinite loop. I expect to have some PRs to fix this in the coming week.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting infinite loop when adding Authentication
I have Authentication API (jwt) for authentication users. Using this for several clients and am in the process of adding the second client ......
Read more >
Infinite loop after entering the credentials | Symantec Access ...
Another possible cause is that the the user is "Authenticated" via the authentication scheme, but not Authorized by policy, thus a loop.
Read more >
Users Experiencing Infinite Loop When Accessing the Okta ...
After submitting credentials on the Okta login page, users are experiencing any infinite looping behavior and are not directed to the end-user dashboard....
Read more >
AAD Authentication Infinite Loop - MSDN - Microsoft
When I run that project it prompts me for the authentication and after hitting sign in button, it goes into infinite loop.
Read more >
Backend login in an infinite loop after changing Authentication ...
After changing the Authentication cookie security field, the backend login is stuck in an infinite loop. ... The field is located under Settings...
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