Skip to main content
Version: 5.15.0

CustomLogin

public BackendReturnObject CustomLogin(string id, string password);
public BackendReturnObject CustomLogin(string id, string password, string etc);

Parameters

ValueTypeDescription
idstringID
passwordstringPassword
etcstring(Optional) Information you wish to save in addition

Description

The account that has successfully undergone custom sign-up may log in by using the custom login function.

Example

Synchronous

BackendReturnObject bro = Backend.BMember.CustomLogin("id" , "password");
if(bro.IsSuccess())
{
Debug.Log("Login successful");
}

Asynchronous

Backend.BMember.CustomLogin("id", "password", (callback) => {
if (callback.IsSuccess()) {
Debug.Log("Login successful");
}
});

SendQueue

SendQueue.Enqueue(Backend.BMember.CustomLogin, "id", "password", (callback) => {
if (callback.IsSuccess()) {
Debug.Log("Login successful");
}
});

ReturnCase

Success cases

When login is successful
statusCode : 200
message : Success

Error cases

When the device information is 'null'
statusCode : 400
errorCode : UndefinedParameterException
message : undefined device_unique_id, device_unique_id cannot be checked

When the ID does not exist
statusCode : 401
errorCode : BadUnauthorizedException
message : bad customId, Invalid customId

When the password is incorrect
statusCode : 401
errorCode : BadUnauthorizedException
message : bad customPassword, Invalid customPassword

When the project status is 'Maintenance' (whitelisted users excluded)
statusCode : 401
errorCode : BadUnauthorizedException
message : bad serverStatus: maintenance, Invalid serverStatus: maintenance

When the user is blocked
statusCode : 403
errorCode : The reason for blocking entered in the console
message : Forbidden blocked user, Blocked user
code : 403100
errorMessage : 757fe1d0-03af-11ef-bda5-fd24a5f141c1 blocked until 2024-11-29T12:41:19.465Z
errorData : {
uuid : 757fe1d0-03af-11ef-bda5-fd24a5f141c1
nickname : Nickname
blockReason : The reason for blocking entered in the console
blockDate : 2024-11-29T12:41:19.465Z
}

If the user is blocked, you can check the following error data.

  • Code : Unique ID for the error case
  • ErrorMessage : Details of that error
  • ErrorData : Detailed data related to the error (If nickname and blockReason do not exist, data cannot be parsed.)

Error use example

var callback = Backend.BMember.CustomLogin("a0", "a0");

Debug.Log(
if (callback.GetMessage().StartsWith("Forbidden blocked user"))
{
StringBuilder returnString = new StringBuilder();
returnString.Append("StatusCode : ").Append(callback.GetStatusCode()).AppendLine();
returnString.Append("ErrorCode : ").Append(callback.GetErrorCode()).AppendLine();
returnString.Append("Message : ").Append(callback.GetMessage()).AppendLine();

returnString.Append("Code : ").Append(callback.GetCode()).AppendLine();
returnString.Append("ErrorMessage : ").Append(callback.GetErrorMessage()).AppendLine();

returnString.Append("errorData(uuid) : ").Append(callback.GetErrorData()["uuid"].ToString()).AppendLine();

if (callback.GetErrorData().ContainsKey("nickname"))
{
returnString.Append("errorData(nickname) : ").Append(callback.GetErrorData()?["nickname"].ToString()).AppendLine();
}

if (callback.GetErrorData().ContainsKey("blockReason"))
{
returnString.Append("errorData(blockReason) : ").Append(callback.GetErrorData()?["blockReason"].ToString()).AppendLine();
}

returnString.Append("errorData(blockDate) : ").Append(callback.GetErrorData()["blockDate"].ToString()).AppendLine();

Debug.Log(returnString.ToString());
}
)

When the device is blocked
statusCode : 403
errorCode : ForbiddenException
message : Forbidden blocked device, Blocked device
code : 403100
errorMessage : 20240426092307fc5ac478c is blocked
errorData : {
deviceUniqueId : 20240426092307fc5ac478c
}

If the device is blocked, you can check the following error data.

  • Code : Unique ID for the error case
  • ErrorMessage : Details of that error
  • ErrorData : Detailed data related to the error

Error use example

var callback = Backend.BMember.CustomSignUp("a0", "a0");

Debug.Log(
if (callback.IsDeviceBlockError())
{
StringBuilder returnString = new StringBuilder();
returnString.Append("StatusCode : ").Append(callback.GetStatusCode()).AppendLine();
returnString.Append("ErrorCode : ").Append(callback.GetErrorCode()).AppendLine();
returnString.Append("Message : ").Append(callback.GetMessage()).AppendLine();
returnString.Append("Code : ").Append(callback.GetCode()).AppendLine();
returnString.Append("ErrorMessage : ").Append(callback.GetErrorMessage()).AppendLine();
returnString.Append("errorData(deviceUniqueId)").Append(callback.GetErrorData()["deviceUniqueId"].ToString()).AppendLine();
Debug.Log(returnString.ToString());
}
)

When withdrawal is in progress (after calling the WithdrawAccount method)
statusCode : 410
errorCode : GoneResourceException
message : Gone user, This user does not exist