Skip to content

socialSignIn

POST
/api/auth/sign-in/social
curl --request POST \
--url https://example.com/api/auth/sign-in/social \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "callbackURL": "example", "newUserCallbackURL": "example", "errorCallbackURL": "example", "provider": "apple", "disableRedirect": true, "idToken": { "token": "example", "nonce": "example", "accessToken": "example", "refreshToken": "example", "expiresAt": 1, "user": { "name": { "firstName": "example", "lastName": "example" }, "email": "example" } }, "scopes": [ "example" ], "requestSignUp": true, "loginHint": "example", "additionalData": { "additionalProperty": "example" } }'

Sign in with a social provider

Media typeapplication/json
object
callbackURL

Callback URL to redirect to after the user has signed in

string
newUserCallbackURL
string
errorCallbackURL

Callback URL to redirect to if an error happens

string
provider
required
Any of:
string
Allowed values: apple atlassian cognito discord facebook figma github microsoft google huggingface slack spotify twitch twitter dropbox kick linear linkedin gitlab tiktok reddit roblox salesforce vk zoom notion kakao naver line paybin paypal polar railway vercel wechat
disableRedirect

Disable automatic redirection to the provider. Useful for handling the redirection yourself

boolean
idToken
object
token
required

ID token from the provider

string
nonce

Nonce used to generate the token

string
accessToken

Access token from the provider

string
refreshToken

Refresh token from the provider

string
expiresAt

Expiry date of the token

number
user

The user object from the provider. Only available for some providers like Apple.

object
name
object
firstName
string
lastName
string
email
string
scopes

Array of scopes to request from the provider. This will override the default scopes passed.

Array<string>
requestSignUp

Explicitly request sign-up. Useful when disableImplicitSignUp is true for this provider

boolean
loginHint

The login hint to use for the authorization code request

string
additionalData
object
key
additional properties

Success - Returns session details (idToken branch) or an authorize URL (redirect branch)

Media typeapplication/json

Returns session details when idToken is provided, or an authorize URL otherwise

object
token
string
user
object
id
required
string
name
required
string
email
required
string
emailVerified
required
boolean
image
string
createdAt
required
string format: date-time
updatedAt
required
string format: date-time
twoFactorEnabled
boolean
url
string
redirect
required
boolean
Example
{
"user": {
"emailVerified": false,
"twoFactorEnabled": false
}
}

Bad Request. Usually due to missing parameters, or invalid parameters.

Media typeapplication/json
object
message
required
string
Examplegenerated
{
"message": "example"
}

Unauthorized. Due to missing or invalid authentication.

Media typeapplication/json
object
message
required
string
Examplegenerated
{
"message": "example"
}

Forbidden. You do not have permission to access this resource or to perform this action.

Media typeapplication/json
object
message
string
Examplegenerated
{
"message": "example"
}

Not Found. The requested resource was not found.

Media typeapplication/json
object
message
string
Examplegenerated
{
"message": "example"
}

Too Many Requests. You have exceeded the rate limit. Try again later.

Media typeapplication/json
object
message
string
Examplegenerated
{
"message": "example"
}

Internal Server Error. This is a problem with the server that you cannot fix.

Media typeapplication/json
object
message
string
Examplegenerated
{
"message": "example"
}