Redirect to Previous URL after Login in azure active directory

Viewed 900

I have an ASP.NET core web app with React registered in Azure Active Directory, how can I let the user go back to the original url after login redirect?

For example when I share with another user a link like this:

https://myapp.azurewebsites.net/#/route/subroute/254

the user is redirected to the login page

https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/authorize?client_id=***&redirect_uri=https%3A%2F%2Fmyapp.azurewebsites.net%2F.auth%2Flogin%2Faad%2Fcallback&response_type=code&scope=user.read%20openid%20offline_access%20profile&response_mode=form_post

the login works fine but after authentication the user is redirected to the home page

https://myapp.azurewebsites.net/#/

but I want redirect user back to the previous page

https://myapp.azurewebsites.net/#/route/subroute/254

I used this link for the app configuration https://docs.microsoft.com/it-it/azure/active-directory/develop/scenario-web-app-call-api-app-configuration?tabs=aspnetcore

For the app registration I try these redirect uri:

Please can you help me?

0 Answers
Related