Xsolla-logo
  • 文档
  • 创建帐户

静默认证Client-side

get/social/{cross_social_provider_name}/cross_auth

将来自Steam、Xbox或Epic Games的用户JWT交换为您项目中的JWT (projectId)。

您将获得将用户重定向到您项目的链接。

要启用静默认证,请参阅说明

Request
path Parameters
cross_social_provider_name
required
string

用户授权进入的平台名称。可以是steamxboxepicgames

query Parameters
projectId
required
string <uuid>

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

login_url
string

URL to redirect the user to after account confirmation, successful authentication, two-factor authentication configuration, or password reset confirmation. Must be identical to the Callback URL specified in the URL block of Publisher Account. For the scenario of a login error, the value should be identical to the the Error callback URL specified in the URL block of Publisher Account. To find the settings, go to Login > your Login project and select the Callback URLs section in the upper block. Required if there are several Callback URLs.

fields
Array of strings non-empty

必须额外从用户或社交网络请求并写入JWT的参数列表。参数必须用逗号分隔。例如,email

如果请求了email而社交网络没有响应email值:

  • 将提示用户在相应的表单中输入邮箱地址(如果集成了登录管理器小组件);
  • 必须要求用户在您自己的界面中输入邮箱地址(如果集成了Login API)。请将该表单的URL发送给您的客户成功经理。

输入邮箱地址后,用户会收到一封邮箱确认消息。要禁用邮箱确认,请联系您的客户成功经理。

session_ticket
string

Session ticket received from the platform encoded according to the Base64 standard.

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,保持现有值的激活状态。
app_id
string

Your app ID on the platform. Required if the platform where the user is authorized is Steam.

code
string

从平台收到的代码。

is_redirect
boolean
Default: true

显示艾克索拉登录管理器服务器应如何响应。如果设置:

  • true值,艾克索拉登录管理器服务器将返回302响应代码。包含用户JWT以用于用户重定向的URL在Location标头中。
  • false值,艾克索拉登录管理器服务器返回200响应代码。包含用户JWT以用于用户重定向的URL在响应正文中。
no_user_creation
boolean
Default: false

Do not create new user if they not exist yet. Existing users will be authorized as usual

deployment_id
string

The deployment ID that the client is trying to authenticate with. This will impact interactions with other services that require a deployment. If the deployment is not public, only users who have been entitled will be able to log in. For more information on deployments and deployment IDs see Product, Sandbox, and Deployment IDs. Note: You must use this unique identifier to use the Ecommerce APIs, and to request access tokens used by game clients.

Responses
200

确定

302

重定向

400

错误的请求

404

未找到

422

无法处理的实体

429

请求过多

Request samples
curl --request GET \
  --url 'https://login.xsolla.com/api/social/{cross_social_provider_name}/cross_auth?projectId=SOME_STRING_VALUE&login_url=SOME_STRING_VALUE&fields=SOME_ARRAY_VALUE&session_ticket=SOME_STRING_VALUE&payload=SOME_STRING_VALUE&with_logout=0&app_id=SOME_STRING_VALUE&code=SOME_STRING_VALUE&is_redirect=true&no_user_creation=false&deployment_id=SOME_STRING_VALUE'
Response samples
application/json
{
  • "login_url": "string"
}