## Getting a user token 
To get the token, send one of the following requests:
* user registration ([JWT](https://developers.xsolla.com/api/login/operation/jwt-register-new-user) or [OAuth 2.0](https://developers.xsolla.com/api/login/operation/oauth-20-register-new-user))
* authentication by username and password ([JWT](https://developers.xsolla.com/api/login/operation/auth-by-username-and-password), [OAuth 2.0](https://developers.xsolla.com/api/login/operation/oauth-20-auth-by-username-and-password), or [JWT auth by username and password](https://developers.xsolla.com/api/login/operation/jwt-auth-by-username-and-password))
* authentication via social networks ([JWT](https://developers.xsolla.com/api/login/operation/jwt-auth-via-social-network) or [OAuth 2.0](https://developers.xsolla.com/api/login/operation/oauth-20-auth-via-social-network))
* silent authentication ([JWT](https://developers.xsolla.com/api/login/operation/jwt-silent-authentication) or [OAuth 2.0](https://developers.xsolla.com/api/login/operation/oauth-20-silent-authentication))
* [authentication via a social network access token](https://developers.xsolla.com/api/login/operation/jwt-auth-via-access-token-of-social-network)
* [authentication via a publishing platform](https://developers.xsolla.com/api/login/operation/auth-by-custom-id)

After JWT authentication, the user is redirected to the Callback URL with a token in a query-parameter: `<Callback URL>?token=<User token (JWT)>`.
After OAuth 2.0 protocol-based authentication, send the [Generate JWT](https://developers.xsolla.com/api/login/operation/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](https://developers.xsolla.com/api/login/operation/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.

