Set up Login Android SDK
To integrate the Login Android SDK:
- Set up Xsolla Login in your Publisher Account.
- Install and initialize the library.
- Set up event processing and SDK methods.
Set up Login in Publisher Account
- Go to your project and click Connect in the Login block. You can go to the Login settings from any section of Publisher Account by clicking the Login button in the left-hand-side menu.

- Go to Login projects and click Set up Login.

- Specify a Login name and click Create.

- Go to General settings > URL block and specify the Callback URL that the user is redirected to after the email confirmation or password reset.
- Select the Xsolla storage in the User data storage block.
Install the library
The library is available in JCenter.
To install the library:
- Start Android Studio.
- Open build.gradle file of your application.
- Add the following line to the dependencies section, where <version_number> is the required version of the Login Android SDK:
- groovy
implementation 'com.xsolla.android:login:<version_number>'
Initialize the library
To initialize the library:
- If you did not specify the Callback URL in your Publisher Account, add the following line to your Android project source code:
- kotlin
val loginConfig = LoginConfig.JwtBuilder()
.setProjectId("login-project-id")
.build()
XLogin.init(applicationContext, loginConfig)
// OR
val loginConfig = LoginConfig.OauthBuilder()
.setProjectId("login-project-id")
.setOauthClientId("oauth2-client-id")
.build()
XLogin.init(applicationContext, loginConfig)
Note:
The default Callback URL is https://login.xsolla.com/api/blank.
- if you specified Callback URL in your Publisher Account, add the following lines to your Android project source code:
- kotlin
val loginConfig = LoginConfig.JwtBuilder()
.setProjectId("login-project-id")
.setCallbackUrl("your-callback-url")
.build()
XLogin.init(applicationContext, loginConfig)
// OR
val loginConfig = LoginConfig.OauthBuilder()
.setProjectId("login-project-id")
.setOauthClientId("oauth2-client-id")
.setCallbackUrl("your-callback-url")
.build()
XLogin.init(applicationContext, loginConfig)
Was this article helpful?
Thank you for your feedback!
We'll review your message and use it to help us improve your experience.