Using Google Sign In to get authorization from user and then accessing user information from the PeopleAPI

43 Views Asked by At

in my android app I'm using Google Sign-In to allow users an option to log in along with other log in methods

When I present the sign in page, I can request for access to users date of birth, gender etc using Scopes. However i cant figure out how to actually access that data after the user gives their consent. I only can access email ID and name. But not things like date of birth and gender.

After the user signs in, I get an object of GoogleSignInAccount type

I've searched online the advice seems to be to use the PeopleAPI but I cant find a clear link between the GoogleSignIn API that i'm using and the PeopleAPI - how do i "transfer" the authorization from the GoogleSignIn API to the PeopleAPI ? I want to let the People API know that my user has already consented


1

There are 1 best solutions below

0
user3462009 On

Take a look at Google's Authorization for Android documentation for best practices to implement native authorization on Android. You can ask for relevant scopes for the user, and don't need to align with a sign in for the user.