2

I call "/.auth/login/google" (or other providers) from my Blazor static web app. Once the user consents, control is routed back to the index page. Is there a way to specify that I'd like a different return page, e.g. via something like "/.auth/login/google?callback=http..."?

Vince
  • 583
  • 5
  • 20
  • Have you tried this and it doesn't work? This current issue raised by me on the AzureAD Github Repo may "answer" your question - https://github.com/AzureAD/microsoft-identity-web/issues/1968 - it's been classified as a bug. – MrC aka Shaun Curtis Dec 20 '22 at 21:56

1 Answers1

14

Inside of an Azure Static Web App (saying Static Blazor App I am assuming that you are using an Azure Static Web App) the query param is: post_login_redirect_uri rather than the callback that you are using.

https://learn.microsoft.com/en-us/azure/static-web-apps/authentication-authorization#set-up-post-sign-in-redirect

The route to the redirect page is relative to the login page itself so if you have 2 routes in your BLazor app:

  • index
  • redirect

then the link to the login page would be /.auth/login/google?post_login_redirect_uri=/redirect

Stacy Cashmore
  • 156
  • 2
  • 3