title: Redirect to Previous URL after Login in azure active directory
body: <p>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?</p>
  <p>For example when I share with another user a link like this:</p>
  <p><a href="https://myapp.azurewebsites.net/#/route/subroute/254" rel="nofollow noreferrer">https://myapp.azurewebsites.net/#/route/subroute/254</a></p>
  <p>the user is redirected to the login page</p>
  <p><a href="https://login.microsoftonline.com/%7Btenantid%7D/oauth2/v2.0/authorize?client_id=***&amp;redirect_uri=https%3A%2F%2Fmyapp.azurewebsites.net%2F.auth%2Flogin%2Faad%2Fcallback&amp;response_type=code&amp;scope=user.read%20openid%20offline_access%20profile&amp;response_mode=form_post" rel="nofollow noreferrer">https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/authorize?client_id=***&amp;redirect_uri=https%3A%2F%2Fmyapp.azurewebsites.net%2F.auth%2Flogin%2Faad%2Fcallback&amp;response_type=code&amp;scope=user.read%20openid%20offline_access%20profile&amp;response_mode=form_post</a></p>
  <p>the login works fine but after authentication the user is redirected to the home page</p>
  <p><a href="https://myapp.azurewebsites.net/#/" rel="nofollow noreferrer">https://myapp.azurewebsites.net/#/</a></p>
  <p>but I want redirect user back to the previous page</p>
  <p><a href="https://myapp.azurewebsites.net/#/route/subroute/254" rel="nofollow noreferrer">https://myapp.azurewebsites.net/#/route/subroute/254</a></p>
  <p>I used this link for the app configuration
  <a href="https://docs.microsoft.com/it-it/azure/active-directory/develop/scenario-web-app-call-api-app-configuration?tabs=aspnetcore" rel="nofollow noreferrer">https://docs.microsoft.com/it-it/azure/active-directory/develop/scenario-web-app-call-api-app-configuration?tabs=aspnetcore</a></p>
  <p>For the app registration I try these redirect uri:</p>
  <ul>
  <li><a href="https://myapp.azurewebsites.net/signin-oidc" rel="nofollow noreferrer">https://myapp.azurewebsites.net/signin-oidc</a></li>
  <li><a href="https://myapp.azurewebsites.net/.auth/login/aad/callback" rel="nofollow noreferrer">https://myapp.azurewebsites.net/.auth/login/aad/callback</a></li>
  </ul>
  <p>Please can you help me?</p>