# [JWT] Auth by custom ID Authenticates a user by a particular custom ID. If the user does not exist, they are created. Endpoint: POST /users/login/server_custom_id Version: v1 Security: Server ## Query parameters: - `projectId` (string) 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. Recommended maximum length less than 500 characters. Note, that this parameter is only available if you use a custom user data storage. - `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 Customer Success Manager to link project_id to publisher_project_id. - `with_logout` (string) 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 fields (application/json): - `attributes` (array) User attributes that are updated or created on authduring authentication. Example: [{"attr_type":"server","key":"company","permission":"private","value":"facebook-promo"},{"attr_type":"server","key":"custom-id","permission":"private","value":48582}] - `attributes.attr_type` (string, required) Definition of user’s access level to service attributes: * client - A user-editable attribute. The values for this type of attributes are entered by a user or specified according to the in-game logics on the client side. For example, the name and character stats, game difficulty level, etc. * server - A read-only attribute. The values for this type of attributes are entered and edited on the server side of your application. We recommend that you use them for configuration of game character stats or user parameters that shouldn’t change regularly. For example, chance to get a bonus, game character key parameters, user categories, etc. Enum: "client", "server" - `attributes.key` (string, required) Name of attribute that is used to identify user’s attribute. Must be unique per user. - `attributes.permission` (string, required) Definition of user’s access level to other users’ attributes. Enum: "private", "public" - `attributes.read_only` (boolean) - `attributes.value` (any, required) - `server_custom_id` (string, required) Custom ID that already exists on your server. Note: It is not the same ID as the Xsolla Login user ID. Example: "1234567890asdfghjkl" - `social_profile` (object) User social profile. Example: {"platform":"xbox","user_id":4352354} - `social_profile.platform` (string, required) Name of the social provider. Example: "xbox" - `social_profile.user_id` (string, required) User ID from a social provider. Example: 4352354 - `user_profile` (object) User profile. This fields describe the user data. Example: {"nickname":"John_Doe_1337"} - `user_profile.nickname` (string, required) User nickname. The value will be added to the nickname field in the user JWT. Can't be empty. Spaces are allowed, but will be trimmed before and after the nickname. Can be non-unique. You can change the user's nickname value in the Xsolla system using the same method. Example: "John_Doe_1337" ## Response 200 fields (application/json): - `token` (string, required) Xsolla Login user JWT. Example: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6IiIsImV4cCI6MTY1MzEyMzk5MCwiZ3JvdXBzIjpbXSwiaWF0IjoxNjUzMDM3NTkwLCJpc3MiOiJodHRwczovL2xvZ2luLnhzb2xsYS5jb20iLCJwdWJsaXNoZXJfaWQiOjMsInNlcnZlcl9jdXN0b21faWQiOiJteS1jdXN0b20taWQtbm90LWxpbmtlZCIsInN1YiI6IjI0MTBkNmMzLWFhZDEtNGY0OS04ODNlLTQ2Y2FkM2ZiMmJjMiIsInR5cGUiOiJzZXJ2ZXJfY3VzdG9tX2lkIiwidXNlcm5hbWUiOm51bGwsInhzb2xsYV9sb2dpbl9hY2Nlc3Nfa2V5IjoiSFhzTVZSWmRtd2tuZXNZMG1pNEpUMVhJUm43bVM4ZU5oc1FxaTU4bmtCayIsInhzb2xsYV9sb2dpbl9wcm9qZWN0X2lkIjoiMTM3NTkyM2ItODdmMy00YTIwLWFjMmItZDBhMjg3MzBlNDIwIn0.D8dFMN5Bmgnpejq1EhZUZQP_D5iFhpO_RXnVyE03qUI" ## Response 400 fields (application/json): - `error` (object, required) - `error.code` (string, required) Error code. Example: "003-061" - `error.description` (string, required) Error description. Example: "Object not found." - `error.details` (object) Additional information. ## Response 401 fields (application/json): - `error` (object, required) - `error.code` (string, required) Error code. Example: "003-061" - `error.description` (string, required) Error description. Example: "Object not found." - `error.details` (object) Additional information. ## Response 404 fields (application/json): - `error` (object, required) - `error.code` (string, required) Error code. Example: "003-061" - `error.description` (string, required) Error description. Example: "Object not found." - `error.details` (object) Additional information. ## Response 422 fields (application/json): - `error` (object, required) - `error.code` (string, required) Error code. Example: "003-061" - `error.description` (string, required) Error description. Example: "Object not found." - `error.details` (object) Additional information. ## Response 429 fields (application/json): - `error` (object, required) - `error.code` (string, required) Error code. Example: "003-061" - `error.description` (string, required) Error description. Example: "Object not found." - `error.details` (object) Additional information.