이 섹션에서는 로그인 작업을 위한 API 호출에 대해 설명합니다. 요청을 전송하기 전에 관리자 페이지에서 로그인 프로젝트를 설정해야 합니다.
로그인 API는 다음 토큰 유형을 지원합니다.
인증 체계에 따라 API 호출이 클라이언트 측인지 서버 측인지 확인할 수 있습니다:
Authorization
header: Bearer <user_JWT>
header,
where <user_JWT>
— is the user token.X-SERVER-AUTHORIZATION: <server_JWT>
, where
<server_JWT>
— is the server token.토큰을 가져오려면 다음 요청 중 하나를 전송합니다.
JWT 인증 후 사용자는 <Callback URL>?token=<User token (JWT)>
쿼리 매개 변수로 된 토큰이 있는 콜백
URL로 리디렉션됩니다.
After OAuth 2.0 protocol-based authentication, send the Generate
JWT POST
request to the Xsolla Login server to exchange the received code
parameter
for a user token (access_token
).
When the access token expires, the client sends Generate
JWT POST
request endpoint on the Xsolla Login server. The request body must include the
following parameters:
grant_type
— JWT grant type, pass the refresh_token
value.client_id
— OAuth 2.0 client ID.refresh_token
— refresh token received in response to the user authorization
request.서버 토큰을 가져오는 방법:
애플리케이션의 백엔드에서 Generate JWT API 호출을 사용하여 서버 JWT를 가져오는 메서드를 구현합니다. 요청에는 다음 매개 변수가 포함되어야 합니다.
grant_type
is the type of getting JWT, pass the client_credentials
value.client_secret
is the secret key that is received when you set up the server
OAuth 2.0 client.client_id
is the client ID received when you set up the server OAuth 2.0
client.When the server token expires, generate a new token using the Generate JWT API call. The request body must include the following parameters:
grant_type
— JWT grant type, pass the client_credentials
value.client_id
— OAuth 2.0 client ID.client_secret
— OAuth 2.0 client secret key.To prevent Xsolla system overloads and protect against sudden spikes in
incoming traffic, Xsolla limits the number of requests received by the Xsolla
API within a specified period of time. If the limit is exceeded, the Xsolla API
returns an HTTP response with the 429
status code.
Rate limits vary by method, IP-address, authentication scheme, and other factors.
Rate limits for server-side methods are applied to methods with server-side
authentication — methods that are called with the X-SERVER-AUTHORIZATION:
<server_JWT>
header, where <server_JWT>
is the server
token.
Rate limits for client-side methods are applied to methods without
authentication or with client-side authentication — methods that are called
with the Authorization: Bearer <user_JWT>
header, where
<user_JWT>
is the user token.
Example of a method with server-side authentication: Example of a method with client-side authentication:
Rate limits for client-side methods do not change and are necessary to prevent brute-force attacks. The maximum request rate for server-side methods is higher than for client-side methods. You can refer to the recommendations on how to manage rate limits in the documentation.
모든 토큰은 JWT 형식을 가지며 페이로드에 명확한 정보를 포함합니다.
토큰은 인증 또는 이메일 주소 확인 후 기본 클레임을 포함하게 됩니다. 이러한 클레임의 존재는 사용자 데이터베이스 및 인증 호출에 의존하지 않습니다.
클레임 | 유형 | 필수 | 설명 |
exp |
Unix 타임스탬프 | 예 | 토큰 만료 날짜 및 시간입니다. 기본 만료 시간은 24시간입니다. 모든 로그인 프로젝트의 만료 시간을 변경할 수 있습니다. |
iss |
string | 예 | 토큰에 서명한 서비스: https://login.xsolla.com . |
iat |
Unix 타임스탬프 | 예 | 토큰을 제공하는 날짜 및 시간입니다. |
sub |
string(UUID) | 예 | 엑솔라 로그인 서버 측에 기록된 사용자 ID. |
groups |
array | 예 |
사용자가 속한 그룹 목록입니다. 모든 그룹은 다음 형식으로 작성됩니다.
하나의 기본 그룹만 있을 수 있습니다. 이 그룹은 초기에 다른 그룹으로 배포되기 전의 모든 사용자를 포함합니다. |
xsolla_login_project_id |
string(UUID) | 예 | 로그인 프로젝트 ID입니다. |
type |
string |
인증 옵션:
하나의 기본 그룹만 있을 수 있습니다. 이 그룹은 초기에 다른 그룹으로 배포되기 전의 모든 사용자를 포함합니다. |
|
avatar |
string | 사용자 아바타 URL입니다. | |
username |
string | 사용자 이름입니다. | |
publisher_id |
integer | 로그인 프로젝트를 소유한 판매자의 ID입니다. | |
email |
string | 사용자 이메일 주소입니다. | |
payload |
string | 인증을 진행하는 동안 페이로드 매개 변수에서 전달되는 추가 정보입니다. | |
promo_email_agreement |
boolean |
다음 값 중 하나일 수 있습니다.
true 값을 가짐.
로그인 위젯의 등록 양식에 기능을 추가하는 방법:
|
|
connection_information |
string | 사용자가 생년월일을 확인했는지 여부를 표시합니다. 확인은 okname 서비스를 통해 진행합니다. |
PlayFab 저장소를 사용하는 경우 인증 후 토큰에 포함된 클레임입니다.
클레임 | 유형 | 필수 | 설명 |
external_account_id |
string | 예 | 사용자 PlayFab ID입니다. |
session_ticket |
string | 예 |
인증 요청 또는 PlayFab API에 대한 요청을 진행하는 동안 수신한 SessionTicket 매개 변수입니다. OAuth 2.0 프로토콜을 통해 사용자를 인증하고 |
entity_token |
string | 예 | EntityToken.EntityToken 매개 변수입니다. |
entity_type |
string | 예 | EntityToken.Entity.Type 매개 변수입니다. title_player_account 값만 가질 수 있습니다. |
entity_id |
string | 예 | EntityToken.Entity.Id 매개 변수입니다. |
사용자 정의 저장소를 사용하는 경우 인증 후 토큰에 포함된 클레임입니다.
클레임 | 유형 | 필수 | 설명 |
provider |
string | 예 | 인증에 사용되는 소셜 네트워크의 이름입니다. 사용자가 사용자 이름과 암호를 통해 인증하는 경우 클레임은 xsolla 값을 갖습니다. |
external_account_id |
string | 서버 측의 사용자 ID입니다. | |
partner_data |
Data of any type returned by your server in the response body during authentication. To enable the transmission of this claim, contact your Customer Success Manager or email to csm@xsolla.com | ||
social_access_token |
Access token of the social network through which the user was authenticated. To enable the transmission of this claim, contact your Customer Success Manager or email to csm@xsolla.com. |
소셜 네트워크를 통한 인증 후에 토큰에 포함된 클레임입니다. 이러한 클레임의 존재는 사용자 데이터베이스에 의존하지 않습니다.
클레임 | 유형 | 필수 | 설명 |
provider |
string | 예 | 인증에 사용된 SNS 이름. |
id |
string | 예 | 소셜 네트워크의 사용자 ID입니다. |
is_cross_auth |
boolean | 암묵 인증 요청이 진행 중임을 표시합니다. | |
social_access_token |
string | 인증에 사용하는 소셜 네트워크 계정 access_token 매개 변수입니다. 이 기능을 설정하려면 계정 관리자에게 문의해야 합니다. |
|
picture |
string(URL) | 소셜 네트워크의 사용자 프로필 사진에 연결합니다. | |
birthday |
date(RFC3339) | 소셜 네트워크의 사용자 생년월일입니다. | |
gender |
string | 소셜 네트워크의 사용자 성별입니다. | |
name |
string | 소셜 네트워크의 사용자 별명입니다. |
서버 토큰은 X-SERVER-AUTHORIZATION
헤더에서 전달됩니다.
토큰 페이로드에는 OAuth 2.0 클라이언트가 소유한 리소스에 대한 정보가 포함되어 있습니다. 토큰은 이러한 리소스에 대한 서버 기반 인증을 사용하여 호출에 액세스할 수 있습니다.
클레임 | 유형 | 필수 | 설명 |
xsolla_login_project_id |
string(UUID) | 예 | OAuth 2.0 클라이언트를 소유한 로그인 프로젝트의 ID입니다. |
resources |
array | 예 |
OAuth 2.0 클라이언트가 소유한 리소스의 목록입니다. 가능한 리소스 유형:
모든 그룹은 다음 형식으로 작성됩니다.
|
jti |
string | 예 | 고유 토큰 ID입니다. |
To validate the JWT, use the following Login API calls:
주의
비밀 키를 누구에게도 알려주어선 안 됩니다. 손상된 경우 업데이트해야 합니다.
Refer to the documentation for information about Xsolla Login API errors.