Repository navigation
Handle direct navigation to the authentication login callback - #69721
vendasankarsf3945 wants to merge 6 commits into
Conversation
|
Thanks for your PR, @vendasankarsf3945. Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
…into fix/54586-login-callback-navigation # Conflicts: # src/Components/test/testassets/Components.TestServer/Components.TestServer.csproj
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved build dependencies, custom-provider compatibility, and test isolation issues block approval.
4 open issues
What changed in this PR
This PR addresses #54586 by restarting login when users navigate directly to a Blazor WebAssembly authentication callback, while preserving iframe callback behavior.
Changes:
- Adds top-level window checks to both authentication providers.
- Updates callback handling and unit tests.
- Adds browser coverage and an MSAL test application.
| File | Description |
|---|---|
| src/Components/WebAssembly/WebAssembly.Authentication/test/RemoteAuthenticatorCoreTests.cs | Tests top-level and iframe callbacks. |
| src/Components/WebAssembly/WebAssembly.Authentication/src/RemoteAuthenticatorViewCore.cs | Restarts login for top-level callbacks. |
| src/Components/WebAssembly/WebAssembly.Authentication/src/Interop/AuthenticationService.ts | Adds OIDC window-context check. |
| src/Components/WebAssembly/Authentication.Msal/src/Interop/AuthenticationService.ts | Adds MSAL window-context check. |
| src/Components/test/testassets/Components.WasmRemoteAuthentication/Pages/TestRemoteAuthentication.razor | Adds root landing route. |
| src/Components/test/testassets/Components.WasmRemoteAuthentication/Pages/SilentAuthentication.razor | Adds silent-authentication observation page. |
| src/Components/test/testassets/Components.WasmMsalRemoteAuthentication/Routes.razor | Configures MSAL test routing. |
| src/Components/test/testassets/Components.WasmMsalRemoteAuthentication/RedirectToLogin.razor | Initiates MSAL login. |
| src/Components/test/testassets/Components.WasmMsalRemoteAuthentication/Program.cs | Configures MSAL authentication paths. |
| src/Components/test/testassets/Components.WasmMsalRemoteAuthentication/Pages/TestRemoteAuthentication.razor | Displays authentication outcome. |
| src/Components/test/testassets/Components.WasmMsalRemoteAuthentication/Pages/Authentication.razor | Hosts authentication actions. |
| src/Components/test/testassets/Components.WasmMsalRemoteAuthentication/Components.WasmMsalRemoteAuthentication.csproj | Defines MSAL test application. |
| src/Components/test/testassets/Components.TestServer/RemoteMsalAuthenticationStartup.cs | Hosts MSAL test endpoints. |
| src/Components/test/testassets/Components.TestServer/RemoteAuthenticationStartup.cs | Adds callback controls and observations. |
| src/Components/test/testassets/Components.TestServer/RazorComponents/RemoteMsalAuthenticationApp.razor | Hosts and instruments MSAL app. |
| src/Components/test/testassets/Components.TestServer/RazorComponents/RemoteAuthenticationApp.razor | Observes iframe callback handling. |
| src/Components/test/testassets/Components.TestServer/Components.TestServer.csproj | References MSAL test dependencies. |
| src/Components/test/E2ETest/Tests/RemoteMsalAuthenticationTest.cs | Tests direct MSAL callback navigation. |
| src/Components/test/E2ETest/Tests/RemoteAuthenticationTest.cs | Tests direct navigation and iframe behavior. |
Review effort: Balanced
|
Looks like this PR hasn't been active for some time and the codebase could have been changed in the meantime. |


Handle explicit login-callback navigation in Blazor WASM
Description
Explicit navigation to
/authentication/login-callbackin Blazor WebAssembly can leave the app stuck in theCompletingLoggingInsegment ofRemoteAuthenticatorView, even though no login flow is active. This makes the app appear broken when users land directly on the callback route.Root cause
Users could explicitly navigate to the
/authentication/login-callbackroute in a Blazor WebAssembly app. In those cases, the app treated the navigation like a normal authentication callback and left the user in theCompletingLoggingInsegment ofRemoteAuthenticatorView, even though no login flow was actively in progress. This caused the app to appear stuck and the user experience to degrade.Changes
/authentication/login-callbackBefore
A user directly navigates to
/authentication/login-callback:CompletingLoggingInsegmentAfter
A user directly navigates to
/authentication/login-callback:Fixes #54586