0
votes

I have an app that uses Google Authentication to sign in. After getting the user id token, I need to get this information from the user's profile:

Email FullName Profile Picture.

I've seen an example using this endpoint:

https://www.googleapis.com/oauth2/v3/tokeninfo?id_token=ID

But this endpoint is not worked for me.

How can I get these profile information?

2

2 Answers

1
votes

Can you try this URL : https://www.googleapis.com/oauth2/v3/userinfo?access_token=access_token.

This URL will return following Information

public class GoogleAuthClass
{
        public string email { get; set; }
        public bool email_verified { get; set; }
        public string name { get; set; }
        public string picture { get; set; }
}
0
votes

You could use the Plugin.GoogleClient nuget and follow this Tutorial.

You will be able to access all the properties from the Google API and manage them as you require.

NOTE: This tutorial uses Firebase Auth.

More information can be seen at: https://www.xamboy.com/2019/11/19/social-media-authentication-google-login-in-xamarin-forms/