Body
application/json
ID token and provider information for authentication
Response
Successfully signed in
Container for session information
User authentication session containing tokens and user information
curl --request POST \
--url https://{subdomain}.auth.{region}.nhost.run/v1/signin/idtoken \
--header 'Content-Type: application/json' \
--data '{
"provider": "apple",
"idToken": "<string>",
"nonce": "<string>",
"options": {
"allowedRoles": [
"me",
"user"
],
"defaultRole": "user",
"displayName": "John Smith",
"locale": "en",
"metadata": {
"firstName": "John",
"lastName": "Smith"
},
"redirectTo": "https://my-app.com/catch-redirection"
}
}'
{
"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",
"isAnonymous": false,
"locale": "en",
"metadata": {
"firstName": "John",
"lastName": "Smith"
},
"phoneNumber": "+12025550123",
"phoneNumberVerified": false,
"roles": [
"user",
"customer"
],
"activeMfaType": "<string>"
}
}
}
Authenticate using an ID token from a supported OAuth provider (Apple or Google). Creates a new user account if one doesn’t exist.
curl --request POST \
--url https://{subdomain}.auth.{region}.nhost.run/v1/signin/idtoken \
--header 'Content-Type: application/json' \
--data '{
"provider": "apple",
"idToken": "<string>",
"nonce": "<string>",
"options": {
"allowedRoles": [
"me",
"user"
],
"defaultRole": "user",
"displayName": "John Smith",
"locale": "en",
"metadata": {
"firstName": "John",
"lastName": "Smith"
},
"redirectTo": "https://my-app.com/catch-redirection"
}
}'
{
"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",
"isAnonymous": false,
"locale": "en",
"metadata": {
"firstName": "John",
"lastName": "Smith"
},
"phoneNumber": "+12025550123",
"phoneNumberVerified": false,
"roles": [
"user",
"customer"
],
"activeMfaType": "<string>"
}
}
}
ID token and provider information for authentication
Successfully signed in
Container for session information
User authentication session containing tokens and user information
Show child attributes
Was this page helpful?