Xsolla-logo

Auth by custom ID

post/users/login/server_custom_id

Authenticates a user by a particular custom ID. If the user does not exist, they are created.

SecurityServer
Request
query Parameters
projectId
string <uuid>

Login project ID from Publisher Account. If you do not specify it, shadow Login will be used for the specified publisher_project_id parameter.

Shadow Login ID you do not need to pass to this call.

payload
string

Your custom data. The value of the parameter will be returned in the payload claim of the user JWT.

publisher_project_id
integer

Project ID from Publisher Account which you make a request for.

If you specify it, but do not specify project_id parameter, service will be found linked to its project_id. Contact your Account Manager to link project_id to publisher_project_id.

with_logout
string
Default: "0"

Shows whether to deactivate the existing user JWT values and activate the one generated by this call. Can have the following values:

  • 1 to deactivate the existing values and activate a new one,
  • 0 to keep the existing values activated.
Request Body schema: application/json
server_custom_id
required
string <= 256 characters

Custom ID is generated by your server (it is not Xsolla Login User ID). It should be in secret key.

Array of objects

Optional param. Contains user`s custom attributes that will saved on auth

object

Social profile which is needed to be linked to the user.

Responses
200

OK

400

Bad Request

401

Unauthorized

404

Not Found

422

Unprocessable Entity

429

Too Many Requests

Request samples
application/json
{
  • "attributes": [
    ],
  • "server_custom_id": "1234567890asdfghjkl",
  • "social_profile": {
    }
}
Response samples
application/json
{
  • "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6IiIsImV4cCI6MTY1MzEyMzk5MCwiZ3JvdXBzIjpbXSwiaWF0IjoxNjUzMDM3NTkwLCJpc3MiOiJodHRwczovL2xvZ2luLnhzb2xsYS5jb20iLCJwdWJsaXNoZXJfaWQiOjMsInNlcnZlcl9jdXN0b21faWQiOiJteS1jdXN0b20taWQtbm90LWxpbmtlZCIsInN1YiI6IjI0MTBkNmMzLWFhZDEtNGY0OS04ODNlLTQ2Y2FkM2ZiMmJjMiIsInR5cGUiOiJzZXJ2ZXJfY3VzdG9tX2lkIiwidXNlcm5hbWUiOm51bGwsInhzb2xsYV9sb2dpbl9hY2Nlc3Nfa2V5IjoiSFhzTVZSWmRtd2tuZXNZMG1pNEpUMVhJUm43bVM4ZU5oc1FxaTU4bmtCayIsInhzb2xsYV9sb2dpbl9wcm9qZWN0X2lkIjoiMTM3NTkyM2ItODdmMy00YTIwLWFjMmItZDBhMjg3MzBlNDIwIn0.D8dFMN5Bmgnpejq1EhZUZQP_D5iFhpO_RXnVyE03qUI"
}