Registering Azure App Service application to use Google Login

Hi!!

I am creating a Xamarin.Forms application and using Azure's Authentication/Authorization to add Facebook and Google as authentication providers. In my code, I am using the LoginAsync() from MobileServiceClient class to perform the login for both Facebook and Google.

I am able to successfully authenticate Facebook users using traveldiary.azurewebsites.net/.auth/login/facebook/callback and get redirected to azure app. However, with Google login, once the code executes LoginAsync(), it takes the user to Google's sign-in page (accounts.google.com/signin/oauth/...) and just stops there. The page is blank and nothing is displayed.

I tried logging in using Chrome with my azure app url (traveldiary.azurewebsites.net/.auth/login/google/callback) and Google login shows up and when I select my gmail account to access the site, I get to a page that shows the message:

traveldiary.azurewebsites.net is currently unable to handle this request. HTTP ERROR 500

I have followed all the steps to configure Google Login from Microsoft site - here. Is there any other setting that is missing that I have to add to make Google sign-in page show up and then redirect to my authorized Redirect URI once successfully logged in.

Thanks for any help or suggestions.

Answers

  • LandLuLandLu Member, Xamarin Team Xamurai

    What platforms did this error occur? And what tutorials are you following to configure your app?
    I think this issue is caused by the Redirect URI. Please check whether you have set that on the Google portal.
    Please notice that you have to create an iOS or Android OAuth ID on Google Apis: https://console.developers.google.com/apis/credentials.
    Try to post your configuration and steps here.

  • Jason_LiJason_Li USMember ✭✭
    edited February 25

    @LandLu said:
    What platforms did this error occur? And what tutorials are you following to configure your app?
    I think this issue is caused by the Redirect URI. Please check whether you have set that on the Google portal.
    Please notice that you have to create an iOS or Android OAuth ID on Google Apis:
    Try to post your configuration and steps here.

    Yes, I have set the Authorized redirect URIs to traveldiary.azurewebsites.net/.auth/login/google/callback with https in Google portal and added an OAuth ID and added a client id and secret key from google in azure portal. I get the blank page in both, iOS and android. I have followed the configurations from the below Microsoft docs (This forum does not allow me to paste links in posts yet) -

    • How to configure your App Service application to use Google login
    • Add authentication to your Xamarin Forms app
Sign In or Register to comment.