Artboard
Google auth

Exchange OAuth Code for Tokens

POST
/otto/api/google-auth/token

Exchange OAuth Code for Tokens

Exchange a Google OAuth authorization code for tokens. If Google credentials are configured, the user's Google Groups will be fetched and added to the ID token's payload before re-signing.

This endpoint is public (no auth required) as it's called during the OAuth flow.

Request Body

POST /otto/api/google-auth/token Request body

application/json
  1. body
client_id*string

Google OAuth client ID

client_secret*string

Google OAuth client secret

code*string

OAuth authorization code

grant_type?string
Default"authorization_code"
redirect_uri*string

OAuth redirect URI

Formaturi
[key: string]?unknown

Response Body

POST /otto/api/google-auth/token Positive response

application/json
  1. response
access_token*string
expires_in*number
id_token*string

JWT with groups claim added

refresh_token?string
scope*string
token_type*string
Example Request
curl -X POST 'https://your.server.net/otto/api/google-auth/token' \  -H 'Content-Type: application/json' \  -d '{  "client_id": "string",  "client_secret": "string",  "code": "string",  "redirect_uri": "http://example.com",  "property1": null,  "property2": null}'
Example Response
{  "access_token": "string",  "expires_in": 0,  "id_token": "string",  "refresh_token": "string",  "scope": "string",  "token_type": "string"}

Was this page helpful?