You are using an unsupported browser. Please update your browser to the latest version on or before July 31, 2020.
close
You are viewing the article in preview mode. It is not live at the moment.
Home > PIXO Platform Unity SDK > Authentication
Authentication
print icon

Authentication

Authentication with Apex is as simple as calling the Login function. If you read the Apex API documentation you can get a better understanding of what is happening under the hood, but the SDK automates nearly everything and makes authentication a breeze.
 

To authenticate, you can either pass a username and password as individual parameters, or bundle them in a LoginData object and pass that instead.
 

  • Login(username : string, password : string) : Boolean
  • Login(login : LoginData) : Boolean


Features of this function are that it:
 

  • Sends the users information to the Apex Server to login.
  • Returns false if the password or login are of zero length.
     

 

OnLoginSuccess is called when the users information is valid.
 

OnLoginFailed is called when the users information is not valid or when the server is not able to be reached.
 

If you want to store authentication information in single LoginData object, simply create a new object and pass the username and password

public LoginData(string username, string password) {

   Login = username;

   Password = password;

}


Using strings:

ApexSystem.login("[email protected]", "123abc")

Using LoginData:

LoginData PixoLoginData = new LoginData(username:"[email protected]", password:"123abc");

ApexSystem.login(PixoLoginData

 

Feedback
0 out of 0 found this helpful

scroll to top icon