# [JWT] Auth via access token of social network


Authenticates the user with the access token using social network credentials.
**Notice**
[Rate limits for client-side methods](/api/login/rate-limits) are applied to this method.

Endpoint: POST /social/{provider_name}/login_with_token
Version: v1

## Path parameters:

  - `provider_name` (string, required)
    Name of the social network connected to the Login in Publisher Account.

Can have the following values: [`xsolla`](/doc/login/how-to/xsolla-account-login/#login_xsolla_button_integration_oauth_client_creation), [`facebook`](https://developers.facebook.com/docs/facebook-login/guides/advanced/manual-flow/), [`google`](https://developers.google.com/identity/protocols/oauth2), [`linkedin`](https://learn.microsoft.com/en-us/linkedin/shared/authentication/client-credentials-flow), [`twitter`](https://developer.twitter.com/en/docs/authentication/oauth-1-0a/api-key-and-secret), [`discord`](https://discord.com/developers/docs/topics/oauth2), [`naver`](https://developers.naver.com/docs/common/openapiguide/appregister), [`baidu`](https://developer.baidu.com/wiki/index.php?title=docs/oauth/client), [`battlenet`](https://develop.battle.net/documentation/guides/using-oauth/client-credentials-flow), [`wechat`](https://developers.weixin.qq.com/doc/oplatform/en/Website_App/WeChat_Login/Wechat_Login.html), [`qq_mobile`](https://wiki.connect.qq.com/oauth2-0%E7%AE%80%E4%BB%8B).

## Query parameters:

  - `projectId` (string, required)
    Login project ID from [Publisher Account](https://publisher.xsolla.com/).

  - `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.

  - `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):

  - `access_token` (string, required)
    Access token received from a social network.

  - `access_token_secret` (string)
    Parameter `oauth_token_secret` received from the authorization request. **Required** for Twitter only.

  - `openid` (string)
    Parameter `openid` received from a social network. **Required** for Wechat only.

## Response 200 fields (application/json):

  - `token` (string, required)
    Xsolla Login user JWT.

## 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 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.

