Sign-up/Login
How to sign up
BACKND provides a total of 3 ways to sign-up for user management.
Sign-up type | Value used to authenticate | Description |
---|---|---|
Custom account | ID/password | Account signed up by the user using the ID/password |
Federation account | Google/Apple/Facebook's token information | Account signed up using the token value provided by Google/Apple/Facebook |
Guest account (Custom account) | Guest account information stored in the device | Account signed up using the account information generated in the device |
How to log in
BACKND provides 4 ways to log in.
If you sign up, the login process is performed at the same time.
accessToken and refreshToken are issued to all Custom, federation, and guest accounts upon their login.
The issued accessToken and refreshToken are stored in the device, which can be used to attempt token login.
Login type | Value used to authenticate | Description |
---|---|---|
Custom account | ID / Password | User logs in manually using an ID/password |
Federation account | Google/Apple/Facebook's token information | User logs in using a token value provided by Google/Apple/Facebook |
Guest account (Custom Account) | Guest account information stored in the device | User logs in using account information generated in the device |
Access token login | accessToken and refreshToken information stored in the device | User logs in using access token information created when trying custom/federation/guest login |
Variables provided upon successful login
Upon successful login, values are assigned to some of the BACKND SDK variables.
The variables are as follows:
Value | Description |
---|---|
Backnd.UserNickName | User's nickname |
Backnd.PlayerInDate | User inDate |
Backnd.UID | User's web coupon UID |
var bro = Backnd.Player.CustomSignIn("backendUser", "backendUser");
if(bro.IsSuccess()) {
Debug.Log("Login successful : " + bro);
Debug.Log($"User's nickname: " + Backnd.UserNickName);
Debug.Log($"User inDate: " + Backnd.PlayerInDate);
Debug.Log($"User UID(for coupon): " + Backnd.UID);
}
else {
Debug.LogError("An error occurred while logging in.");
// Values are not assigned to Backnd.UserNickname, Backnd.PlayerInDate, and Backnd.UID.
}
When attempting to log in via another device while logged in
For any communication, BACKND validates the BACKND Access Token that is issued upon login.
- A single user can only have one valid Access Token.
- If the user is logged in to another device, the validation of the previous Access Token will fail; as a result, the device that was previously logged in can no longer communicate with the server.
- The device that was used for the new login connects to the server without any issues.
If the Access Token is invalid, the following BackndReturnObject is returned:
statusCode : 401
errorCode : BadUnauthorizedException
<!-- message : bad accessToken, Invalid accessToken -->
statusCode : 401
errorCode : BadUnauthorizedException
<!-- message : bad bad,accessToken,,Invalid accessToken, Invalid bad, accessToken,, Invalid,accessToken -->