Verify Google One Tap ID Token and generate magic link

POST /api/google-one-tap/verify

Verify the Google One Tap ID Token, check if the user exists, and generate a magic link for authentication. If the user exists, generates a login magic link; otherwise, generates a registration magic link.

application/json

Body Required

  • idToken string Required

    The Google ID Token from Google One Tap

Responses

  • 200 application/json

    The ID Token was verified successfully and one-time token was generated.

    Hide response attributes Show response attributes object
    • oneTimeToken string Required

      The generated one-time token for authentication

    • isNewUser boolean Required

      Whether this is a new user (registration) or existing user (login)

    • email string Required

      The verified email address from the Google ID Token

  • No content for OPTIONS preflight requests

  • Invalid ID Token, unverified email, or other validation errors

  • Access forbidden, either due to CORS restrictions or feature not enabled

  • Google connector not found

POST /api/google-one-tap/verify
curl \
 --request POST 'https://[tenant_id].logto.app/api/google-one-tap/verify' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"idToken":"string"}'
Request examples
{
  "idToken": "string"
}
Response examples (200)
{
  "oneTimeToken": "string",
  "isNewUser": true,
  "email": "string"
}