Xsolla-logo

Auth via access token of social network

post/social/{provider_name}/login_with_token

Authenticates the user with the access token using social network credentials.

Request
path Parameters
provider_name
required
string

Name of the social network connected to the Login in Publisher Account.

Can have the following values: facebook, google, linkedin, twitter, discord, naver, baidu, wechat, qq_mobile.

query Parameters
projectId
required
string <uuid>

Login project ID from Publisher Account.

payload
string

Your custom data. The value of the parameter will be returned in the payload claim of the user JWT.

with_logout
string
Default: "0"

Shows whether to deactivate the existing user JWT values and activate the one generated by this call. Can have the following values:

  • 1 to deactivate the existing values and activate a new one,
  • 0 to keep the existing values activated.
Request Body schema: application/json
access_token
required
string

Access token received from a social network.

access_token_secret
string

Parameter oauth_token_secret received from the authorization request. Required for Twitter only.

openid
string

Parameter openid received from a social network. Required for Wechat only.

Responses
200

OK

400

Bad Request

404

Not Found

422

Unprocessable Entity

429

Too Many Requests

Request samples
application/json
{
  • "access_token": "string",
  • "access_token_secret": "string",
  • "openid": "string"
}
Response samples
application/json
{
  • "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6InRlc3RAZ21haWwuY29tIiwiZXhwIjoxNjU4MjE5OTYyLCJncm91cHMiOlt7ImlkIjoyLCJuYW1lIjoiZGVmYXVsdCIsImlzX2RlZmF1bHQiOnRydWV9XSwiaWF0IjoxNjU4MTMzNTYyLCJpZCI6IjY1NDYzNjQ4NTcxMjY1NCIsImlzX21hc3RlciI6dHJ1ZSwiaXNzIjoiaHR0cHM6Ly9sb2dpbi54c29sbGEuY29tIiwibmFtZSI6IlRlc3QgdGVzdCIsInBheWxvYWQiOiIxMjM0NTY3ODkwIiwicGljdHVyZSI6IiIsInByb21vX2VtYWlsX2FncmVlbWVudCI6ZmFsc2UsInByb3ZpZGVyIjoiZmFjZWJvb2siLCJwdWJsaXNoZXJfaWQiOjEsInNlcnZlcl9jdXN0b21faWQiOiIxMjM0NTY3ODkwIiwic29jaWFsX2FjY2Vzc190b2tlbiI6ImZhY2Vib29rX3Rva2VuIiwic3ViIjoiYWU5OTQ2NjQtYTRkMi00ODJjLTkyYjAtZmZiNzY3NWQ5ZDE1IiwidHlwZSI6InNvY2lhbCIsInVzZXJuYW1lIjpudWxsLCJ4c29sbGFfbG9naW5fYWNjZXNzX2tleSI6IkhYc01WUlpkbXdrbmVzWTBtaTRKVDFYSVJuN21TOGVOaHNRcWk1OG5rQmsiLCJ4c29sbGFfbG9naW5fcHJvamVjdF9pZCI6IjEzNzU5MjNiLTg3ZjMtNGEyMC1hYzJiLWQwYTI4NzMwZTQyMCJ9.tn5VqaT15MZlI5Jhfii2WC-jr_TwH2J1q27fSRi1EBs"
}