SSO

Workflow

The recommended SSO strategy is to keep original application user management, and code support for La Distribution in a plugin.

The common workflow is:

Additionally you may implement user login, logout.

Methods

Main SSO related methods are located in this class.

http://ladistribution.net/trac/browser/trunk/lib/Ld/Auth.php

Check if user is already authenticated:

Ld_Auth:isAuthenticated()

Get current user infos:

Ld_Auth:getUser();

Get current user username:

Ld_Auth:getUsername();

Try to log in user with username and password:

$result = Ld_Auth::authenticate($user, $pass);
if ($result->isValid()) {
  // code here
} else {
  // code here
}

Log user out:

Ld_Auth::logout();

Examples