Social login

In your application, you can implement user authentication using their account in social networks. If the user’s first login is via a social network, a new account is created automatically. The user doesn’t need to enter a username, email address, or other data.

Social login is performed using web services. The application opens a form in the browser to complete authentication via the selected social network.

Social login can be your application’s primary or alternative authentication method.

If you use social login as an alternative authentication method, the social network account automatically links to an existing user account if the following conditions are met:

  • A user who signed up with a username/email address and password logged into your application via a social network account.
  • A social network returns an email address.
  • The user’s email address in a social network matches the email address used to sign up in your application.

SDK supports the following providers for social login:

  • Amazon
  • Apple
  • Baidu
  • Battle.net
  • Discord
  • Facebook
  • GitHub
  • Google
  • Kakao
  • LinkedIn
  • MSN
  • Mail.ru
  • Microsoft
  • Naver
  • Odnoklassniki
  • PayPal
  • QQ
  • Reddit
  • Steam
  • Twitch.tv
  • Twitter
  • VK
  • Vimeo
  • WeChat
  • Weibo
  • Xbox Live
  • Yahoo
  • Yandex
  • YouTube

To set up authentication through web services:

  1. In the application interface, add buttons for authentication via social networks.
  2. Set up social connections for a Login project in Publisher Account.
  3. Implement authentication logic on the application side.

Set up social connections for Login project in Xsolla Publisher Account

Notice
In Publisher Account, ensure the Classic login and Social login option are selected for the Login project that you use in your application. You can change the login method later by clicking the Change Login method link. Previously saved settings will not be lost.
  1. Open your project in Publisher Account.
  2. In the side menu, click Login.
  3. Click Configure in the pane of a Login project.
  4. Go to the Authentication block and select the Social login section.

  1. Connect social networks that users can use to sign up and log into the application:

    • To connect a social network, click the ⚙ icon and select Connect.
    • To connect several social networks at once, select the required panes (their borders will turn green). Then, from the Manage drop-down menu, select Connect.
    • To connect all available social networks, click Select all. Then, from the Manage drop-down menu, select Connect.
Note
Xsolla’s Application ID and secret key are used for authentication by default. If your application is set up using a developer account of the social provider, you can specify your own Application ID and secret key. Detailed instructions for locating the Application ID and secret are available in the social network card settings in Publisher Account.

Integrate on application side

Implement the following logic when clicking the social login button:

  1. Get the sign-up/login page URL using the getLinkForSocialAuth method from the Login library.
  2. Open the sign-up/login page in a browser.
  3. Track the page URL change after successful user authentication.
  4. Get the authentication code from the URL of the active page.
  5. Exchange the authentication code for a token using the generateJWT method from the Login library.

Was this article helpful?
Thank you!
Is there anything we can improve? Message
We’re sorry to hear that
Please explain why this article wasn’t helpful to you. Message
Thank you for your feedback!
We’ll review your message and use it to help us improve your experience.
Rate this page
Rate this page
Is there anything we can improve?

Don’t want to answer

Thank you for your feedback!

Useful links

Last updated: January 22, 2024

Found a typo or other text error? Select the text and press Ctrl+Enter.

Report a problem
We always review our content. Your feedback helps us improve it.
Provide an email so we can follow up
Thank you for your feedback!