Fix for multiple reload of application
See original GitHub issueCore Library
MSAL.js v2 (@azure/msal-browser)
Core Library Version
2.15.0
Wrapper Library
MSAL Angular (@azure/msal-angular)
Wrapper Library Version
2.0.4
Description
Let’s say, our redirectURI is configured to - http://localhost:4200 and we’re kicking the Authentication (by MSALGuard) in the route - http://localhost:4200/myprofile and we set the option - “navigateToLoginRequestUrl”: true
Now, we see the application loads twice -
- After redirecting
- It’s navigating to the desired route.
As per this article, this is expected - https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-angular/docs/v2-docs/performance.md#how-to-configure-azuremsal-angular-to-use-your-routers-navigate-function-for-client-side-navigation
Is there any fix available for this? I mean use the Angular Router instead of window.location to avoid the second reload of the application
MSAL Configuration
auth: {
authority: 'https://login.microsoftonline.com/xxx-xxx-xxx/',
clientId: 'xxx-xxx-xxx-xxxx-xxx',
redirectUri: 'http://localhost:4200',
postLogoutRedirectUri: 'xxxx-xxx-xxx',
navigateToLoginRequestUrl: true
},
cache: {
cacheLocation: 'sessionStorage'
},
Relevant Code Snippets
No response
Identity Provider
Azure AD / MSA
Source
External (Customer)
Issue Analytics
- State:
- Created a year ago
- Comments:7 (7 by maintainers)
Top GitHub Comments
@roopeshreddy If the provided navigation behavior does not suite your needs, you can implement your own.
For MSAL Angular, you can provide this by calling
this.msalService.instance.setNavigationClient(navigationClient)
.Thanks @jasonnutter This helps!