Authentication via device ID
Device ID authentication lets users start using the application on a mobile device without entering registration data. The first time a user logs in to the application using the device ID, a new account is created automatically, and the user doesn’t need to enter a username, email address, or other data.
With the device ID, you can implement user authentication on one or more mobile devices in the background mode. To use this function, the user should link the device ID to an existing account.
The device ID is generated by the platform and is available in applications installed on the mobile device. The SDK gets the ID value via the platform API and uses this value to perform various functions with the Xsolla API. The iOS device ID is passed in the UIDevice.identifierForVendor property.
To enable user authentication via device ID for your project:
- Open your project in Publisher Account and go to the Login section.
- Click Configure in the pane of a Login project.
- In the top settings block, click Login API integration.
- Set the Login with device ID toggle to On.
- Click Save changes.
The SDK implements methods for the functions listed below.
Authentication
SDK method name | Description |
---|---|
authWithDeviceId | Authenticates the user to the application using the current device ID. |
logUserOut | Ends the active user session. |
Account upgrade
SDK method name | Description |
---|---|
addUsernameAndPassword | Adds a username, email address, and password, that can be used for authentication, to the current account. |
addUsernameAndPassword
method can be used to upgrade an account created in any available way (e.g. by using a social network or an email address and password).Device management
SDK method name | Description |
---|---|
getUserDevices | Returns a list of devices linked to the current user account. |
linkDeviceToAccount | Links the specified device to the current user account. |
unlinkDeviceFromAccount | Unlinks the specified device from the current user account. |
Found a typo or other text error? Select the text and press Ctrl+Enter.