Xsolla-logo

JWT 생성하기

post/oauth2/token

이 호출을 사용합니다.

  • 사용자 JWT 가져오기.
  • JWT가 만료될 경우 JWT를 새로 고침합니다. 등록 또는 인증 호출에서 'scope=offline'이 전달된 경우에만 작동합니다.
  • 서버 JWT 가져오기. 사용자 참여는 필요하지 않습니다.

이 호출의 사용은 grant_type 매개변수의 값에 따라 다릅니다.

Request
Request Body schema: application/x-www-form-urlencoded
grant_type
required
string

JWT를 가져오는 유형입니다. 가능한 유형:

  • authorization_code. 인증 호출에서 수신한 코드를 JWT로 교환할 때 사용합니다. code 매개변수 값을 지정해야 합니다.
  • refresh_token. 이전 값이 만료되었을 때 새로고침한 JWT를 가져옵니다. refresh_token 매개변수 값을 지정해야 합니다.
  • client_credentials. 서버 JWT를 가져옵니다. client_idclient_secret 매개변수 값을 지정해야 합니다.
client_id
required
string

Your application ID. The value for this parameter depends on the value of the grant_type parameter:

Note that values for client_secret and client_id parameters should be used from the same client.

refresh_token
string

grant_type 매개변수의 authorization_code 또는 refresh_token 값을 갖는 이 호출의 마지막 요청에 대한 응답으로 수신한 이 매개변수의 값입니다. 'grant_type=refresh_token'인 경우 필수입니다.

client_secret
string

Your secret key. The value for this parameter depends on the value of the grant_type parameter:

  • If it’s authorization_code, create an OAuth 2.0 client and use its secret key. Required if you created an OAuth 2.0 client with confidential authentication type.
  • If it’s client_credentials, contact your Customer Success Manager to create a server OAuth 2.0 client and get its secret key. Required for this client type.

Note that values for client_secret and client_id parameters should be used from the same client.

redirect_uri
string
code
string

JWT로 교환되는 인증 코드입니다. 'grant_type=authorization_code'인 경우 필수입니다.

code_verifier
string

The code verifier for the PKCE request, that the app originally generated before the authorization request.

Responses
200

확인

400

잘못된 요청

404

찾을 수 없음

418

찻주전자라 커피를 끓일 수 없음

422

처리할 수 없는 엔터티

429

요청이 너무 많음

Request samples
application/x-www-form-urlencoded
refresh_token=string&grant_type=string&client_secret=string&client_id=string&redirect_uri=string&code=string&code_verifier=string
Response samples
application/json
{
  • "access_token": "2YotnFZFEjr1zCsicMWpAA",
  • "expires_in": 3600,
  • "refresh_token": "tGzv3JOkF0XG5Qx2TlKWIA",
  • "scope": "email user_profile",
  • "token_type": "bearer"
}