Skip to main content
Version: 5.11.4

LoginWithTheBackendToken

public BackendReturnObject LoginWithTheBackendToken();

Description

User who logged in before tries to log in using a BACKND AccessToken stored in the device locally.
BACKND SDK's login method requires an unexpired access_token or refresh_token stored in the device.
When the login succeeds, access_token and refresh_token are updated with new ones.

Example

Synchronous

BackendReturnObject bro = Backend.BMember.LoginWithTheBackendToken();
if(bro.IsSuccess())
{
Debug.Log("Automatic login successful");
}

Asynchronous

Backend.BMember.LoginWithTheBackendToken((callback) =>
{
if(callback.IsSuccess())
{
Debug.Log("Automatic login successful");
}
});

SendQueue

SendQueue.Enqueue(Backend.BMember.LoginWithTheBackendToken, (callback) =>
{
if(callback.IsSuccess())
{
Debug.Log("Automatic login successful");
}
});

Return cases

Success cases

When the login is successful
statusCode : 201

Error cases

When the user tries token login but there is no local access token in the device
statusCode : 400
errorCode : accessTokenError

When there is an attempt without customLogin
statusCode : 400
errorCode : UndefinedParameterException

When the refresh_token expires because the user logged in to another device
statusCode : 401
errorCode : BadUnauthorizedException

When the user is blocked
statusCode : 403
errorCode : Reason for blocking entered in the console

When the refresh_token has expired after one year
statusCode: 410 errorCode: GoneResourceException,