Xsolla-logo

通过用户名和密码进行认证

post/oauth2/login

通过指定的用户名/电子邮件和密码对用户进行认证。要完成用户认证,请通过发送生成JWT请求来获取用户JWT。

Request
query Parameters
response_type
required
string

启用了OAuth 2.0协议项目中使用的授权类型。必须是code才能在响应中获取用户认证代码。必须通过生成JWT调用将收到的代码交换给JWT以完成用户认证。

client_id
required
integer

您的应用程序ID。在创建OAuth 2.0客户端后获取。

state
required
string

用于额外用户验证的值。通常用于抵御CSRF攻击。该值将在响应中返回。必须长于8个符号。

audience
string

The "aud" (audience) claim identifies the recipients that the JWT is intended for. Each principal intended to process the JWT MUST identify itself with a value in the audience claim. If the principal processing the claim does not identify itself with a value in the "aud" claim when this claim is present, then the JWT MUST be rejected. In the general case, the "aud" value is an array of case- sensitive strings, each containing a StringOrURI value. In the special case when the JWT has one audience, the "aud" value MAY be a single case-sensitive string containing a StringOrURI value. The interpretation of audience values is generally application specific. Use of this claim is OPTIONAL.

scope
string

范围是OAuth 2.0中的一种机制,用于限制应用程序对用户帐户的访问。

可以是:

如果您要处理上面未提及的自定义scope参数值,可以在使用此调用时设置这些参数。艾克索拉登录管理器服务器不会处理这些值,但会在收到的JWT中返回它们。

redirect_uri
string

URL to redirect the user to after account confirmation, successful authentication, or password reset confirmation. To set up this parameter, contact your Account Manager.

Notice. The parameter is required if you have more than one redirect URI in your project settings.
Request Body schema: application/json
username
required
string

用户名或邮箱地址。

password
required
string

用户密码。

Responses
200

确定

400

错误的请求

401

未授权

404

未找到

422

无法处理的实体

429

请求过多

Request samples
application/json
{
  • "password": "password123",
  • "username": "John"
}
Response samples
application/json
{
  • "login_url": "string"
}