Skip to main content

googleAuth

Public: no authentication required.

Signs in with a Google ID token. When no user matches the Google account it returns signupRequired and the Google profile instead of signing in. Customer accounts are refused, and so are accounts without admin-console access when called from the console. A required second factor cannot be skipped. On success it returns tokens and a session token and sets sign-in cookies for web clients. No sign-in needed.

Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.

Example:

mutation GoogleAuth($token: String!) {
googleAuth(token: $token) {
accessToken
authenticated
refreshToken
sessionToken
signupRequired
pendingUser {
name
avatar
email
}
}
}

Variables:

{
"token": "string"
}

Response:

{
"data": {
"googleAuth": {
"accessToken": "string",
"authenticated": true,
"refreshToken": "string",
"sessionToken": "string",
"signupRequired": true,
"pendingUser": {
"name": "string",
"avatar": "string",
"email": "string"
}
}
}
}
googleAuth(
token: String!
): GoogleAuthResponse!

Arguments​

googleAuth.token ● String! non-null scalar​

The Google ID token returned by Google sign-in.

Type​

GoogleAuthResponse object​

The result of signing in with Google.