authentication
Sign in with an ID token
Authenticate using an ID token from a supported OAuth provider (Apple or Google). If the user doesn't exist and AUTH_DISABLE_AUTO_SIGNUP is not set, a new account will be created. When AUTH_DISABLE_AUTO_SIGNUP is enabled, users must use the /signup/idtoken endpoint to register first.
post/signin/idtoken
Request body
Example request
{
"options": {
"allowedRoles": [
"me",
"user"
],
"defaultRole": "user",
"displayName": "John Smith",
"locale": "en",
"metadata": {
"firstName": "John",
"lastName": "Smith"
},
"redirectTo": "https://my-app.com/catch-redirection"
}
}Response
Successfully signed in
Example response
{
"session": {
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"accessTokenExpiresIn": 900,
"refreshTokenId": "2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24",
"refreshToken": "2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24",
"user": {
"avatarUrl": "https://myapp.com/avatars/user123.jpg",
"createdAt": "2023-01-15T12:34:56Z",
"defaultRole": "user",
"displayName": "John Smith",
"email": "john.smith@nhost.io",
"emailVerified": true,
"id": "2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24",
"locale": "en",
"metadata": {
"firstName": "John",
"lastName": "Smith"
},
"phoneNumber": "+12025550123",
"roles": [
"user",
"customer"
]
}
}
}