I just started using google on-tap sing-in/sign-up in my new app. It works perfectly except that I don't know how can I ask user permissions to access scoped data?
client.verifyIdToken(
token,
CLIENT_ID,
function(e, login) {
var payload = login.getPayload(); // <-- payload just containt name,email and picture. I want more
var userid = payload['sub'];
});
You can use Google Sign-In to authorize more scopes. Pass the email address of the account returned by One-Tap as the
login_hint
parameter to thegapi.auth2.init
call, then callgapi.auth2.getAuthInstance().signIn()
so that the user can grant access to the other scopes your app require.You can also use
gapi.auth2.authorize
for One-Off authorization (if you usegapi.client
to perform requests to Google APIs, you generally want to useinit/signIn
).