La Distribution Wiki

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:

  • Check if user is authenticated.
    • If it is authenticated, check if user is registered in local application
      • If it is not registered, register it
      • Then, use the local application session mechanism to set that the user is authenticated

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

sso.txt · Last modified: 2010/08/02 15:22 by znarfor