# [JWT] Auth via social network


Redirects the user to the page for authentication via the specified social network.
**Notice**
[Rate limits for client-side methods](/api/login/rate-limits) are applied to this method.

Endpoint: GET /social/{provider_name}/login_redirect
Version: v1

## Path parameters:

  - `provider_name` (string, required)
    Name of the social network connected to Login in Publisher Account. Can be: [`amazon`](https://developer.amazon.com/docs/), [`apple`](https://developer.apple.com/documentation/sign_in_with_apple/sign_in_with_apple_rest_api/authenticating_users_with_sign_in_with_apple), [`xsolla`](/doc/login/how-to/xsolla-account-login/#login_xsolla_button_integration_oauth_client_creation), [`baidu`](https://developer.baidu.com/wiki/index.php?title=docs/oauth/client), [`battlenet`](https://develop.battle.net/documentation/guides/using-oauth/client-credentials-flow), [`discord`](https://discord.com/developers/docs/topics/oauth2), [`epicgames`](https://dev.epicgames.com/docs/dev-portal/client-credentials), [`facebook`](https://developers.facebook.com/docs/facebook-login/guides/advanced/manual-flow/), [`github`](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/authorizing-oauth-apps), [`google`](https://developers.google.com/identity/protocols/oauth2),[`kakao`](https://developers.kakao.com/docs/latest/en/kakaologin/common), [`linkedin`](https://learn.microsoft.com/en-us/linkedin/shared/authentication/client-credentials-flow), [`mailru`](https://help.mail.ru/developers/oauth/settings), [`microsoft`](https://learn.microsoft.com/en-us/graph/permissions-reference), [`msn`](https://learn.microsoft.com/en-us/graph/permissions-reference), [`naver`](https://developers.naver.com/docs/common/openapiguide/appregister), [`ok`](https://apiok.ru/dev/app/create#section-2), [`paypal`](https://developer.paypal.com/home/#get-api-credentials), [`qq`](https://wiki.connect.qq.com/__trashed-2), [`reddit`](https://github.com/reddit-archive/reddit/wiki/OAuth2#getting-started), [`steam`](https://partner.steamgames.com/doc/webapi_overview/oauth), [`twitch`](https://dev.twitch.tv/docs/authentication/#registration), [`twitter`](https://developer.twitter.com/en/docs/authentication/oauth-1-0a/api-key-and-secret), [`vimeo`](https://developer.vimeo.com/api/guides/start#register-your-app),[`vk`](https://dev.vk.com/ru/api/getting-started), [`wechat`](https://developers.weixin.qq.com/doc/oplatform/en/Website_App/WeChat_Login/Wechat_Login.html), [`weibo`](https://open.weibo.com/wiki/%E6%8E%88%E6%9D%83%E6%9C%BA%E5%88%B6%E8%AF%B4%E6%98%8E), [`xbox`](https://learn.microsoft.com/en-us/graph/permissions-reference), [`yahoo`](https://developer.yahoo.com/oauth2/guide), [`yandex`](https://yandex.ru/dev/id/doc/ru/register-client), [`youtube`](https://developers.google.com/youtube/registering_an_application).

If you store user data in [PlayFab](https://developers.xsolla.com/doc/login/integration-guide/connect-users-storage/#login_guide_connect_users_storage_playfab), only `twitch` is available.

## Query parameters:

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

  - `login_url` (string)
    URL to redirect the user to after account confirmation, successful authentication, two-factor authentication configuration, or password reset confirmation. Must be identical to the **Callback URL** specified in the **URL** block of [Publisher Account](https://publisher.xsolla.com/). For the scenario of a login error, the value should be identical to the the **Error callback URL** specified in the **URL** block of [Publisher Account](https://publisher.xsolla.com/). To find the settings, go to **Login > your Login project** and select the **Callback URLs** section in the upper block. **Required** if there are several Callback URLs.

  - `fields` (array)
    List of parameters which must be requested from the user or social network additionally and written to the JWT. The parameters must be separated by a comma. For example, `email`.

When the `email` is requested and the social network did not respond with the `email` value:
* the user will be asked to input their email in the corresponding form if you integrated [Login Widget](https://developers.xsolla.com/doc/login/integration-guide/integrate-solution/#login_guide_integration_widget),
* the user must be asked to input their email in the corresponding form of your own interface if you integrated [Login API](https://developers.xsolla.com/doc/login/integration-guide/integrate-solution/#login_guide_integration_api). Please send the URL of this form to your Customer Success Manager.

After the email is inputted, the user receives an email confirmation [message](https://developers.xsolla.com/doc/login/how-to/email-customization/). To disable email confirmation, please contact your Customer Success Manager.

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

  - `locale` (string)
    Region in the `<language code>_<country code>` format, where:

* `language code`: language code in the [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format;
* `country code`: country/region code in the [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format.

The list of social networks will be sorted from most to least used, according to the variable value.

  - `phone_only` (boolean)
    Arrange xsolla wallet form behaivior values:
* `true` show only passwordless by phone,
* `false` all auth methods.

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

