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 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.
You can also implement manual linking of a social network account.
SDK supports the following providers for social login:
- Amazon
- Apple
- Baidu
- Battle.net
- Discord
- GitHub
- Kakao
- MSN
- Mail.ru
- Microsoft
- Naver
- Odnoklassniki
- PayPal
- Steam
- Twitch.tv
- VK
- Vimeo
- Xbox Live
- Yahoo
- Yandex
- YouTube
To set up authentication through web services:
- In the application interface, add buttons for authentication via social networks.
- Set up social connections for a Login project in Publisher Account.
- Implement authentication logic on the application side.
Set up social connections for Login project in Xsolla Publisher Account
- Open your project in Publisher Account.
- In the side menu, click Login.
- Click Configure in the pane of a Login project.
- Go to the Authentication block and select the Social login section.
- 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.
Integrate on application side
To implement the social login logic, call the AuthViaSocialNetwork
SDK method and pass the following parameters to the method:
SocialProvider
— the name of the social networkonSuccess
— successful user authentication callbackonCancelled
— user cancels authentication callbackonError
— error callback
Assets/Xsolla.Demo/Login/Scripts/Login/Auth/SocialAuth.cs
script of the demo project.Useful links
Last updated: December 20, 2024Found a typo or other text error? Select the text and press Ctrl+Enter.