Open sneha-boopal opened 3 years ago
I'm not sure about via react-aad-msal
APIs, but MSAL supports passing the redirectStartPage
parameter, which tells MSAL where to navigate after coming back from the redirect. Note, this requires auth.navigateToLoginRequestUrl
to be enabled.
This is how we do it in MSAL Angular: https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/msal-angular-v1/lib/msal-angular/src/msal-guard.service.ts#L75
Requirement is that after a user logs in via Azure AD (or any identity provider really), they should be redirected to the page they tried to access. Meaning a flow like this:
User tries to access http://localhost:3000/products App redirects them to log in with Azure AD 3)User is redirected back to the application, and should now see the product list instead of getting redirected to index page(http://localhost/products). I tried by adding http://localhost:3000/products in redirectUri but still it is getting redirected to http://localhost:3000. Is it achievable using msal and please provide if there are any sample apps