ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilAuthOpenId Class Reference

Open ID auth class More...

+ Inheritance diagram for ilAuthOpenId:
+ Collaboration diagram for ilAuthOpenId:

Public Member Functions

 __construct ($a_container, $a_addition_options=array())
 Contructor.
 supportsRedirects ()
 Returns true, if the current auth mode allows redirection to e.g to loginScreen, public section...
 callProvider ($username, $status, $auth)
 Auth login function Redirects to openid provider.
- Public Member Functions inherited from Auth
 Auth ($storageDriver, $options= '', $loginFunction= '', $showLogin=true)
 Constructor.
applyAuthOptions (&$options)
 Set the Auth options.
 _loadStorage ()
 Load Storage Driver if not already loaded.
 assignData ()
 Assign data from login form to internal values.
 start ()
 Start new auth session.
 login ()
 Login function.
 setExpire ($time, $add=false)
 Set the maximum expire time.
 setIdle ($time, $add=false)
 Set the maximum idle time.
 setSessionName ($name= 'session')
 Set name of the session to a customized value.
 setShowLogin ($showLogin=true)
 Should the login form be displayed if neccessary?
 setAllowLogin ($allowLogin=true)
 Should the login form be displayed if neccessary?
 setCheckAuthCallback ($checkAuthCallback)
 Register a callback function to be called whenever the validity of the login is checked The function will receive two parameters, the username and a reference to the auth object.
 setLoginCallback ($loginCallback)
 Register a callback function to be called on user login.
 setFailedLoginCallback ($loginFailedCallback)
 Register a callback function to be called on failed user login.
 setLogoutCallback ($logoutCallback)
 Register a callback function to be called on user logout.
 setAuthData ($name, $value, $overwrite=true)
 Register additional information that is to be stored in the session.
 getAuthData ($name=null)
 Get additional information that is stored in the session.
 setAuth ($username)
 Register variable in a session telling that the user has logged in successfully.
 setAdvancedSecurity ($flag=true)
 Enables advanced security checks.
 checkAuth ()
 Checks if there is a session with valid auth information.
 getAuth ()
 Has the user been authenticated?
 logout ()
 Logout function.
 updateIdle ()
 Update the idletime.
 getUsername ()
 Get the username.
 getStatus ()
 Get the current status.
 getPostUsernameField ()
 Gets the post varible used for the username.
 getPostPasswordField ()
 Gets the post varible used for the username.
 sessionValidThru ()
 Returns the time up to the session is valid.
 listUsers ()
 List all users that are currently available in the storage container.
 addUser ($username, $password, $additional= '')
 Add user to the storage container.
 removeUser ($username)
 Remove user from the storage container.
 changePassword ($username, $password)
 Change password for user in the storage container.
 log ($message, $level=AUTH_LOG_DEBUG)
 Log a message from the Auth system.
 _loadLogger ()
 Load Log object if not already loaded.
 attachLogObserver (&$observer)
 Attach an Observer to the Auth Log Source.
 _isAdvancedSecurityEnabled ($feature=null)
 Is advanced security enabled?
- Public Member Functions inherited from ilAuthBase
 getContainer ()
 Get container object.

Protected Member Functions

 initSettings ()
 Init open id settings.
 parseUsername (&$username, $auth)
 Parse username.

Private Attributes

 $settings = null

Additional Inherited Members

- Static Public Member Functions inherited from Auth
_factory ($driver, $options= '')
 Return a storage driver based on $driver and $options.
 staticCheckAuth ($options=null)
 Statically checks if there is a session with valid auth information.
- Data Fields inherited from Auth
 $expire = 0
 $expired = false
 $idle = 0
 $idled = false
 $storage = ''
 $loginFunction = ''
 $showLogin = true
 $allowLogin = true
 $status = ''
 $username = ''
 $password = ''
 $checkAuthCallback = ''
 $loginCallback = ''
 $loginFailedCallback = ''
 $logoutCallback = ''
 $_sessionName = '_authsession'
 $version = "@version@"
 $advancedsecurity = false
 $_postUsername = 'username'
 $_postPassword = 'password'
 $session
 $server
 $post
 $cookie
 $authdata
 $authChecks = 0
 $logger = null
 $enableLogging = false
 $regenerateSessionId = false
- Protected Attributes inherited from ilAuthBase
 $sub_status = null

Detailed Description

Open ID auth class

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 11 of file class.ilAuthOpenId.php.

Constructor & Destructor Documentation

ilAuthOpenId::__construct (   $a_container,
  $a_addition_options = array() 
)

Contructor.

Returns
Parameters
object$a_container
object$a_addition_options,[optional]

Definition at line 21 of file class.ilAuthOpenId.php.

References $_GET, $_POST, ilAuthBase\initAuth(), initSettings(), and Auth\setSessionName().

{
$a_container,
$a_addition_options,
array($this,'callProvider'),
true);
$this->setSessionName("_authhttp".md5(CLIENT_ID));
$this->initAuth();
$this->initSettings();
if(isset($_GET['oid_check_status']))
{
$_POST['username'] = 'dummy';
$_POST['password'] = 'dummy';
}
}

+ Here is the call graph for this function:

Member Function Documentation

ilAuthOpenId::callProvider (   $username,
  $status,
  $auth 
)

Auth login function Redirects to openid provider.

Parameters
object$username
object$status
object$auth
Returns

Definition at line 62 of file class.ilAuthOpenId.php.

References $_POST, $auth, $ilCtrl, Auth\$username, AUTH_WRONG_LOGIN, Auth_OpenID_SRegRequest\build(), parseUsername(), and ilUtil\redirect().

{
global $ilCtrl;
$username = $_POST['oid_username'];
{
return false;
}
$consumer = $this->settings->getConsumer();
$oid_auth = $consumer->begin($username);
if (!$oid_auth)
{
return false;
}
include_once 'Auth/OpenID/SReg.php';
// Required
array('nickname'),
// Optional
array(
'fullname',
'dob',
'email',
'gender',
'postcode',
'language',
'timezone'
)
);
if ($sreg_req)
{
$oid_auth->addExtension($sreg_req);
}
// TODO: Switch openid v. 1,2
$url = $oid_auth->redirectURL(ILIAS_HTTP_PATH,$this->settings->getReturnLocation());
}

+ Here is the call graph for this function:

ilAuthOpenId::initSettings ( )
protected

Init open id settings.

Returns

Definition at line 112 of file class.ilAuthOpenId.php.

References ilOpenIdSettings\getInstance().

Referenced by __construct().

{
include_once './Services/OpenId/classes/class.ilOpenIdSettings.php';
$this->settings = ilOpenIdSettings::getInstance();
$this->settings->initConsumer();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAuthOpenId::parseUsername ( $username,
  $auth 
)
protected

Parse username.

Returns

Definition at line 123 of file class.ilAuthOpenId.php.

References $_POST, $auth, $GLOBALS, Auth\$username, AUTH_WRONG_LOGIN, and ilOpenIdProviders\getInstance().

Referenced by callProvider().

{
if($_POST['oid_provider'])
{
include_once './Services/OpenId/classes/class.ilOpenIdProviders.php';
try
{
$url = ilOpenIdProviders::getInstance()->getProviderById($_POST['oid_provider'])->getURL();
$username = sprintf($url,(string) $username);
$GLOBALS['ilLog']->write(__METHOD__.': Using '.$username.' for authentication');
return true;
}
catch(UnexpectedValueException $e)
{
$GLOBALS['ilLog']->write(__METHOD__.': Unknown provider id given: '.$username);
return false;
}
}
if($this->settings->forcedProviderSelection())
{
return false;
}
$GLOBALS['ilLog']->write(__METHOD__.': Trying openid url: '.$username);
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAuthOpenId::supportsRedirects ( )

Returns true, if the current auth mode allows redirection to e.g to loginScreen, public section...

Todo:
check if redirects are possible
Returns

Reimplemented from ilAuthBase.

Definition at line 49 of file class.ilAuthOpenId.php.

{
return true;
}

Field Documentation

ilAuthOpenId::$settings = null
private

Definition at line 13 of file class.ilAuthOpenId.php.


The documentation for this class was generated from the following file: