Uses google.accounts.oauth2.initTokenClient instead
of the ID-token flow. This is the classic OAuth2 implicit-style
token grant: you get a bare access token, not a signed identity
token, so the client has to call an API (here,
userinfo) to learn who the user is. This is the
pattern you'd use for requesting extra scopes (Drive, Calendar,
etc.), not just login.
Raw token grant response (from initTokenClient):
Raw userinfo response:
There's no separate "verify" step to run in this flow — verification is implicit. Unlike the ID-token variants, there's no signed JWT to check; instead, the endpoint this page calls with the access token only returns data when the token is valid and non-expired:
GET https://www.googleapis.com/oauth2/v3/userinfo Authorization: Bearer <access_token>
If the token were forged or expired, that request would fail with a 401 instead of returning a profile — Google is doing the verification server-side as part of answering the call.
End-to-end flow:
gsi/client scriptrequestAccessToken() opens Google's consent popupuserinfo (or any authorized API) with Authorization: Bearer <token>