Authentication with the PIXO Platform is as simple as calling the Login function. If you read the xAPI 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 user's information to the PIXO Platform Server to login
- Returns false if the password or login are of zero length
Authentication Responses
-
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.
LoginData
If you want to store authentication information in single LoginData object, simply create a new object and pass the username and password.
Constructor
public LoginData(string username, string password)
{ Login = username;
Password = password;
}
Example Code
Using Strings
ApexSystem.login("pixo@pixovr.com", "123abc")
Using LoginData
LoginData PixoLoginData = new LoginData(username:"pixo@pixovr.com", password:"123abc");
ApexSystem.login(PixoLoginData