Skip to content
code google oauth

Verify a Google access token

By , Google Workspace alum Published 1 min read

Last verified in 2023. APIs or CLI flags may have changed; browse newer #google posts.

You can verify a Google access token by querying the OAuth2 tokeninfo endpoint:

curl "https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=$GOOGLE_ACCESS_TOKEN"

The response includes the scope and token metadata. For a service account access token, it looks like this:

{
  "issued_to": "1068863916064001234",
  "audience": "1068863916064001234",
  "user_id": "1068863916064001234",
  "scope": "https://www.googleapis.com/auth/userinfo.email openid",
  "expires_in": 3555,
  "email": "my-service-account@my-project.iam.gserviceaccount.com",
  "verified_email": true,
  "access_type": "online"
}