/
v3.0.11Get access

socialNetworkLoginV2

Step 1 of the SSO V2 flow (social login with additional registration fields). Call it with the authorization code from the social network redirect. Unlike `socialNetworkLogin`, it never creates an account silently. If the social identity is already known, the session is logged in and `data` holds the usual login fields (`user_id`, `auth_token`, ...). If the identity is new, nothing is created: `data` holds a `registration` object with the profile data the social network returned and a short-lived registration token. Show your registration form pre-filled (and locked) with that data, let the player complete the remaining required fields, and submit them with the token to `registerUserBySocialInfo`. The token expires 10 minutes after this response, and the authorization code is single-use, so after expiry the player has to restart the social login. Works on a plain session; no prior login is required.

Request parameters:

Name
DescriptionTypeValuesDefault
code
Authorization code received from the social network redirect. It is single-usestring--
socialNetworkTypeId
Social network the authorization code comes from. The SDK maps the name to the numeric id the backend expectsstringSocial Types-
redirectUrl
Redirect URL used when requesting the authorization code. Must match the one registered with the social network. Omit it to use the defaultstring--
state
Extracted state receive from social platform. When redirecting from social platform state is placed in route ( https://example.com?state=<stateExample>. Required parameter for fully completing SSO authenticationstring--
This method is usually used with these methods:

Call example:

socialNetworkLoginV2({
  code: '4/0AVGzR1DkX...',
  socialNetworkTypeId: 'google',
  redirectUrl: 'https://www.example.com/social-callback'
})

Response examples:

{
  errorKey: '',
  hasError: false,
  errorMessage: '',
  data: {
    registration: {
      token: '3b7d0f4a9c2e4f8b8a6d1c5e7f9a2b4c',
      expires_at: 1789552800,
      social_network_type: 1,
      email: '[email protected]',
      first_name: 'John',
      last_name: 'Doe'
    }
  }
}

Response parameters:

NameDescriptionTypeValues
user_id
Known identity only. Id of the logged-in playernumber-
auth_token
Known identity only. Auth token of the logged-in session, used to restore the login laterstring-
jwe_token
Known identity only, optional. JWE token of the session, when the partner uses onestring-
deposit_count
Known identity only. Number of deposits the player has madenumber-
deposit_amount
Known identity only. Total amount the player has depositednumber-
withdrawal_amount
Known identity only. Total amount the player has withdrawnnumber-
authentication_status
Known identity only. Authentication status of the session (e.g. whether a further verification step is pending)number-
is_new_client
Known identity only. Whether the player is a new clientbooleantrue / false
qr_code_origin
Known identity only. QR code origin, when two-factor authentication is set upstring-
needs_subscriptions_update
Known identity only, optional. Whether the player has to update their subscriptionsbooleantrue / false
time_to_wait_in_minutes
Known identity only. Minutes the player has to wait before the next attempt, when one is enforcednumber-
registration
New identity only. No account has been created yet; pass `token` and the completed form to `registerUserBySocialInfo`object
└─ token
Social registration token to send as `socialRegistrationToken` to `registerUserBySocialInfo`. Valid for 10 minutesstring-
└─ expires_at
Unix timestamp at which the registration token expiresnumber-
└─ social_network_type
Social network the identity comes from: 1 google, 2 facebook, 3 twitter, 4 telegram. The SDK exports the `SOCIAL_NETWORK_TYPE_ID` map to decode itnumber1, 2, 3, 4
└─ email
Optional. Email returned by the social network; keep it read-only in the form, since a different email is rejected with `SocialRegistrationEmailMismatch`string-
└─ first_name
Optional. First name returned by the social networkstring-
└─ last_name
Optional. Last name returned by the social networkstring-