1. Home
  2. Docs
  3. UniREST Solution 3.5
  4. UniREST Client
  5. Login and Registration
  6. User Registration

User Registration

User Registration

Logging in into the UniREST system is possible only if an account has been previously registered. Registering a new account just requires a unique username, a password and the use of Registration() method:

_ = UniRESTClient.Async.Registration(username, password, callBack);
ParameterData-typeDescription
usernamestringThe user username. The maximum allowed length is 32 characters.
passwordstringThe user password.
callBackAction<bool>The function to call or the code to execute at operations completed.
Returned valueDescription
boolThis method just returns true or false.

If the user registration occurs without problems, this method returns true. This method is for registration only and doesn’t perform any login operation.

If something goes wrong and the registration fails, this method returns false.

_ = UniRESTClient.Async.Registration("pluto", "planet9", (bool ok) =>
    {
       if (ok)
       {
           Debug.Log("Registration done!");
       }
       else
       {
           Debug.Log("Registration failed!");
       }
    });

Once a new account is registered, it’s added to the user table and it becomes visible in the UniREST Server Database Manager:

Note that the password is sha256 coded.

In case of failure, a special code is released to the UniRESTClient class. See the ''Technical Details'' chapter for more info.

DBResponse

After a successful user account registration, the UniREST Server replies with the ID of this new account. This ID is available in the DBResponse property:

UniRESTClient.DBresponse;
_ = UniRESTClient.Async.Registration("pluto", "planet9", (bool ok) =>
    {
       if (ok)
       {
           Debug.Log("Registration done! New user ID: " + UniRESTClient.DBResponse);
       }
       else
       {
           Debug.Log("Registration failed!");
       }
    });