Search code examples
angularazuregoogle-signinazure-authentication

How to use Azure Authorization social providers with a static html angular website?


I have followed this documentation on how to use the azure social authorization provider for google plus sign-in. https://learn.microsoft.com/en-us/azure/app-service-mobile/app-service-mobile-how-to-configure-google-authentication

After authentication is finished it sends the app to this page: https://yourapp.azurewebsites.net/.auth/login/done

Is the post_login_redirect_url a way to redirect back to your web application and pass the token?

Is there anyway to redirect back to your static html website with the token?


Solution

  • After looking more into the post_login_redirect_url it looks like the way is that this parameter is attached like this /.auth/login/?post_login_redirect_url=/

    You can then grab the token from your url as it is stored in the hash value.

    This question was helpful: How to set Azure Authentication custom login return url?

    Another way to get the token that I found was to call /.auth/me to get back your authorized array of tokens.