Xsolla-logo
  • 文档
  • 创建帐户

通过社交网络的访问令牌进行认证Client-side

post/social/{provider_name}/login_with_token

使用社交网络凭据通过访问令牌对用户进行认证。

Request
path Parameters
provider_name
required
string

连接到发布商帐户中登录管理器的社交网络的名称。

可以是以下值:facebookgooglelinkedintwitterdiscordnaverbaiduwechatqq_mobile

query Parameters
projectId
required
string <uuid>

发布商帐户中的登录管理器项目ID。

payload
string

Your custom data. The value of the parameter will be returned in the payload claim of the user JWT. Recommended maximum length less than 500 characters. Note, that this parameter is only available if you use a custom user data storage.

with_logout
string
Default: "0"

显示是否停用现有用户JWT值并激活此调用生成的值。可以是以下值:

  • 1,停用现有值并激活新值;
  • 0,保持现有值的激活状态。
Request Body schema: application/json
access_token
required
string

从社交网络收到的访问令牌。

access_token_secret
string

从授权请求中收到的参数oauth_token_secret。 仅对于Twitter为必需

openid
string

从社交网络接收的参数openid。 仅对于Wechat为必需

Responses
200

确定

400

错误的请求

404

未找到

422

无法处理的实体

429

请求过多

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