You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When doing a login or token acquisition using redirect, the login server redirects back to
the redirectUri, before then redirecting to the last used url or the redirectStartPage location.
As far as I can tell, it always uses window.location.replace/assign in BrowserUtils at the moment.
It would be really helpful if I could hook into this somehow and instead use my router's navigate
method, so that my SPA doesn't have to be reloaded again!
I'm currently doing this by setting navigateToLoginRequestUrl to false and adding an event
handler to try and do the same kind of thing myself. (i.e. storing the URL in localStorage
when the interactionType is redirect and the eventType is msal:loginStart or msal:acquireTokenStart, and then navigating when the eventType is msal:handleRedirectEnd. It appears to work, but doesn't seem like something I should
need to be doing).
Source
Internal (Microsoft)
Customer request
The text was updated successfully, but these errors were encountered:
@jamesots Thanks for the suggestion. With the way handleRedirectPromise is currently designed doing something like this would be challenging. Even if we provide a way to override the method used to redirect you would then run into issues processing the token response. We'll take this under consideration and think about how something like this could be implemented cleanly but for now, what you've described above is in line with our recommendation for handling this scenario. We also welcome PRs if you have a solution in mind!
Library
msal@1.x.x
or@azure/msal@1.x.x
@azure/msal-browser@2.8.0
@azure/msal-node@1.x.x
@azure/msal-react@1.0.0-alpha.1
@azure/msal-angular@0.x.x
@azure/msal-angular@1.x.x
@azure/msal-angular@2.x.x
@azure/msal-angularjs@1.x.x
Description
When doing a login or token acquisition using redirect, the login server redirects back to
the
redirectUri
, before then redirecting to the last used url or theredirectStartPage
location.As far as I can tell, it always uses
window.location.replace/assign
inBrowserUtils
at the moment.It would be really helpful if I could hook into this somehow and instead use my router's
navigate
method, so that my SPA doesn't have to be reloaded again!
I'm currently doing this by setting
navigateToLoginRequestUrl
to false and adding an eventhandler to try and do the same kind of thing myself. (i.e. storing the URL in localStorage
when the interactionType is
redirect
and the eventType ismsal:loginStart
ormsal:acquireTokenStart
, and then navigating when the eventType ismsal:handleRedirectEnd
. It appears to work, but doesn't seem like something I shouldneed to be doing).
Source
The text was updated successfully, but these errors were encountered: