Authentication, Login, and Logout

User Account Role

All Corrigo user accounts created for wSDK integration must be assigned a role with the following permission:

  • Permissions - Web Services Access

Establishing an authenticated session

Authenticated sessions may be established using the following web method:

  • LogInCompany (string username, string password, string companyname)
  • Username = User Account created for integration component
  • Password = User password
  • CompanyName = Name of the application instance to authenticate the User

Check the return value of the LogInCompany method to ensure the login is successful. Bad credentials or incorrect company names may attribute to the failure.

LoginResponse loginResponse = (LoginResponse) corrigoService.LogInCompany(
   userId, password, companyName);

if (loginResponse.Success)
{
   Console.WriteLine("Login Successful!");
}
else
{
   Console.WriteLine("Login Failed!");
}

Checking your login status

A recommended best practice is to periodically validate your web service session using the LoginStatus method, since sessions expire automatically due to inactivity.

LoginResponse loginResponse = (LoginResponse) corrigoService.LogInStatus();

if (loginResponse.Success)
{ 
   Console.WriteLine("Login Status Active.");
}
else
{
   Console.WriteLine("Login Status InActive.");
}

Log out

In general, it is recommended that the client explicitly log out using the LogOut method when finished, to preserve server resources.

corrigoService.LogOut();

Next: Entities and Base Classes