Hi @Louis Fequet ,
Thanks for reaching out. Based on your description, here are key points to check for the “spins indefinitely” login issue in Blazor Server + MSAL + Azure AD:
- MSAL client type - For server-side apps, a confidential client is recommended. Using
AcquireTokenInteractiveas a public client may work locally but often fails when deployed. https://learn.microsoft.com/en-us/entra/msal/msal-client-applications https://learn.microsoft.com/en-us/entra/msal/dotnet/getting-started/scenarios - Redirect URI - Ensure the URI in Azure AD matches your deployed domain, port, and path. A mismatch can prevent the login response from reaching your app. https://docs.azure.cn/en-us/entra/identity-platform/scenario-web-app-sign-user-app-configuration https://docs.azure.cn/en-us/entra/identity-platform/how-to-add-redirect-uri https://docs.azure.cn/en-us/entra/identity-platform/reply-url
- HTTPS & hosting - Redirects require HTTPS. If behind a proxy or load balancer, ensure the original scheme is forwarded correctly; otherwise login may stall.
- Authentication flow - In Blazor Server, rely on the standard server-side OpenID Connect flow instead of manually calling
AcquireTokenInteractive. - Additional info needed - Exact redirect URIs, proxy/load balancer setup, browser/server errors, and HTTPS configuration. This will help pinpoint the issue if it persists.
Following these checks should help identify likely causes. Once you provide the details above, more specific guidance can be offered.
Hope this helps! If my answer was helpful - kindly follow the instructions here so others with the same problem can benefit as well.