-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add onRedirectNavigate to redirect operations in browser #2669
Conversation
change/@azure-msal-browser-2020-11-30-15-01-27-browser-onredirectnavigate.json
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you update the request docs with this new param + maybe a usage example?
I will definitely add a usage example. Do we still need the standalone docs for request/response? Would be nice to have those docs fully automated (typedoc, in this case). |
I think the request docs are out of date anyway. I'm all for automating it if they're still easy to find (I don't know where the typedocs live today) |
…rary-for-js into browser-onredirectnavigate
Yeah, the request/response docs are very much out of date, and so I would propose deleting them, since the typedocs will always be update to date in theory. cc: @pkanher617 Or, just have the existing markdown files just link to the typedocs. https://azuread.github.io/microsoft-authentication-library-for-js/ref/msal-browser/ |
onRedirectNavigate: (url) => { | ||
expect(url).to.be.eq(testLogoutUrl); | ||
done(); | ||
return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI @pkanher617 this can be how apps stop the redirect from happening during logout
Let's delete the docs and update the links to those docs to point to the typedocs? |
Done. |
This PR closed issue #2127, but I do not see how it solves the problem described by that issue. I guess msalInstance.logout({
onRedirectNavigate: () => {
window.localStorage.clear();
window.sessionStorage.clear();
return false;
}
}); Is that the recommended way to logout of a specific application without logging out of all apps tied to an AAD session? imo it would be great to have this mentioned in the logout doc. I was surprised that calling |
Yes, using
Yes, I have it on my list to update that document as apart of #2546. |
Perfect, thank you @jasonnutter! |
Hey there. I set onRedirectNavigate to false with updated msal-browser and msal-react packages but I fail to authenticate the user with msalInstance.handleRedirectPromise(redirectUrl). It says that there is no redirection in progress, returning null. Is there some other way to get it authenticated in this library? |
Adds
onRedirectNavigate
callback from v1 (#1691).This adds a new callback for
loginRedirect
,acquireTokenRedirect
, andlogout
to allow applications to get the URL that would be navigated to, and to stop navigation. This is to support scenarios where applications want to perform the redirect themselves, instead of relying on MSAL.Usage:
Also includes a sample Chromium extension demonstrating the usage.
TODO: