I've created a repo based on react-sample-app which uses redirection for login. But I spent a few days just trying to make it work with "react-route-dom". The main problem was to keep the user on the same URL after login redirection happens. After the page is refreshed, the router library loses the state with the previous location. As a workaround, I used localStorage. And now I'm curious, is it a better way to do so.
Repository: https://github.com/ssuvorov/MS-SSO-react-example
My flow is the following:
/login.window.location.reload().auth.loginRedirect() from any path? I'd like to avoid redirection to /login. Currently, if I use login() from http://localhost:3000/protected it returns/protected page after redirection happens?It is possible to call loginRedirect() from any page. Please set auth.navigateToLoginRequestUrl: true in your main configuration and pass the url you would like the user to end up on as the redirectStartPage parameter passed into loginRedirect(). The reason you are getting this error is because you are not setting the auth.redirectUri parameter and it is defaulting to the page that initiated the request. Please make sure to set the auth.redirectUri to the redirectUri registered in the app portal.
@tnorling magic! 馃憤Thank you a lot!
I'd wait till the token expires and check how it behaves in this case.
Unfortunately, there is not. You can submit feedback here if this is something you would like to see.
Closing as this has been answered, but feel free to open a new ticket if you have any other issues
Most helpful comment
Unfortunately, there is not. You can submit feedback here if this is something you would like to see.
Closing as this has been answered, but feel free to open a new ticket if you have any other issues