microsoft / azurechat

🤖 💼 Azure Chat Solution Accelerator powered by Azure Open AI Service
MIT License
1.22k stars 1.17k forks source link

Microsoft 365 Login/Azure Active Directory Sign In "Loop" - Cannot Login #418

Closed WEMcJJJ closed 1 month ago

WEMcJJJ commented 1 month ago

I've got the site up and working, and I can login just fine with GitHub. However, when I try to login with the "Microsoft 365" button I end up at the page with the GitHub and Microsoft 365 Sign in buttons and it never gets past that. Here's a little more detail of what happens:

  1. Go to main website
  2. Click the "Microsoft 365" button
  3. Redirected to login.microsoftonline.com and prompted to Sign in. I enter my username and click "Next"
  4. I get redirected to Okta to sign in (yes, it's a little weird they way it's setup, Okta verifies the user instead of Azure AD - Okta syncs users with Azure AD) and I enter my username and click "Next"
  5. I choose to have a push notification sent, and I get it and approve it
  6. I get redirected to enter my password, so I enter it and click "Verify"
  7. It goes back to login.microsoftonline.com and asks if I want to stay signed in, and I click "Yes"
  8. I'm redirected to the page (https:///api/auth/signin) that has "Sign in with GitHub" and "Sign in with Azure Active Directory"
  9. If I click on "Sign in with Azure Active Directory" it just comes right back to that page
bwitzig-zen commented 1 month ago

@WEMcJJJ If possible, check and see if you can get the email field set with an automation for your users. A decent amount of applications will use the email field as the "identity" for the user (including Azurechat).

WEMcJJJ commented 1 month ago

Thanks @bwitzig-zen, I actually figured it out, and a fix for it, and a similar fix has been addressed in #430, which explains the issue and adds a fix for it.