ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilAuthProviderShibboleth Class Reference

Shibboleth authentication provider. More...

+ Inheritance diagram for ilAuthProviderShibboleth:
+ Collaboration diagram for ilAuthProviderShibboleth:

Public Member Functions

 __construct (\ilAuthCredentials $credentials)
 Constructor. More...
 
 doAuthentication (\ilAuthStatus $status)
 Do apache auth. More...
 
- Public Member Functions inherited from ilAuthProvider
 __construct (ilAuthCredentials $credentials)
 Constructor. More...
 
 getLogger ()
 Get logger. More...
 
 getCredentials ()
 

Private Attributes

 $migration_account = ''
 

Additional Inherited Members

- Data Fields inherited from ilAuthProvider
const STATUS_UNDEFINED = 0
 
const STATUS_AUTHENTICATION_SUCCESS = 1
 
const STATUS_AUTHENTICATION_FAILED = 2
 
const STATUS_MIGRATION = 3
 
- Protected Member Functions inherited from ilAuthProvider
 handleAuthenticationFail (ilAuthStatus $status, $a_reason)
 Handle failed authentication. More...
 

Detailed Description

Shibboleth authentication provider.

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

Constructor & Destructor Documentation

◆ __construct()

ilAuthProviderShibboleth::__construct ( \ilAuthCredentials  $credentials)

Constructor.

Parameters
\ilAuthCredentials$credentials

Definition at line 30 of file class.ilAuthProviderShibboleth.php.

31  {
32  parent::__construct($credentials);
33 
34  }

Member Function Documentation

◆ doAuthentication()

ilAuthProviderShibboleth::doAuthentication ( \ilAuthStatus  $status)

Do apache auth.

Parameters
\ilAuthStatus$status

Implements ilAuthProviderInterface.

Definition at line 40 of file class.ilAuthProviderShibboleth.php.

References $_SERVER, $DIC, $ilSetting, ilObjUser\_lookupId(), shibUser\buildInstance(), ilShibbolethRoleAssignmentRules\doAssignments(), shibServerData\getInstance(), ilShibbolethPluginWrapper\getInstance(), ilAuthProvider\getLogger(), ilAuthProvider\handleAuthenticationFail(), ilAuthStatus\setAuthenticatedUserId(), ilAuthStatus\setStatus(), ilAuthStatus\STATUS_AUTHENTICATED, and ilShibbolethRoleAssignmentRules\updateAssignments().

41  {
42  global $DIC; // for backword compatibility of hook environment variables
43  $ilias = $DIC['ilias'];
44  $ilSetting = $DIC['ilSetting'];
45  $shibServerData = shibServerData::getInstance();
46 
47  //$this->getLogger()->dump($shibServerData);
48 
49  if ($shibServerData->getLogin()) {
50  $shibUser = shibUser::buildInstance($shibServerData);
51  // for backword compatibility of hook environment variables
52  $userObj =& $shibUser; // For shib_data_conv included Script
53  $newUser = $shibUser->isNew(); // For shib_data_conv included Script
54  if ($shibUser->isNew()) {
55  $shibUser->createFields();
56  $shibUser->setPref('hits_per_page', $ilSetting->get('hits_per_page'));
57 
58  // Modify user data before creating the user
59  // Include custom code that can be used to further modify
60  // certain Shibboleth user attributes
61  if ($ilias->getSetting('shib_data_conv') AND $ilias->getSetting('shib_data_conv') != ''
62  AND is_readable($ilias->getSetting('shib_data_conv'))
63  ) {
64  include($ilias->getSetting('shib_data_conv'));
65  }
66  $shibUser = ilShibbolethPluginWrapper::getInstance()->beforeCreateUser($shibUser);
67  $shibUser->create();
68  $shibUser->updateOwner();
69  $shibUser->saveAsNew();
70  $shibUser->writePrefs();
71  $shibUser = ilShibbolethPluginWrapper::getInstance()->afterCreateUser($shibUser);
73  } else {
74  $shibUser->updateFields();
75  // Include custom code that can be used to further modify
76  // certain Shibboleth user attributes
77  if ($ilias->getSetting('shib_data_conv') AND $ilias->getSetting('shib_data_conv') != ''
78  AND is_readable($ilias->getSetting('shib_data_conv'))
79  ) {
80  include($ilias->getSetting('shib_data_conv'));
81  }
82  // $shibUser->update();
83  $shibUser = ilShibbolethPluginWrapper::getInstance()->beforeUpdateUser($shibUser);
84  $shibUser->update();
85  $shibUser = ilShibbolethPluginWrapper::getInstance()->afterUpdateUser($shibUser);
87  }
88 
90  $status->setAuthenticatedUserId(ilObjUser::_lookupId($shibUser->getLogin()));
91 
92 
93 
94  #$this->setAuth($shibUser->getLogin(), $shibUser);
95  #ilObjUser::_updateLastLogin($shibUser->getId());
96  #if ($_GET['target'] != '') {
97  # ilUtil::redirect('goto.php?target=' . $_GET['target'] . '&client_id=' . CLIENT_ID);
98  #}
99  }
100  else
101  {
102  $this->getLogger()->info('Shibboleth authentication failed.');
103  $this->handleAuthenticationFail($status, 'err_wrong_login');
104  return false;
105  }
106 
107  }
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
static _lookupId($a_user_str)
Lookup id by login.
static buildInstance(shibServerData $shibServerData)
getLogger()
Get logger.
global $ilSetting
Definition: privfeed.php:17
handleAuthenticationFail(ilAuthStatus $status, $a_reason)
Handle failed authentication.
global $DIC
+ Here is the call graph for this function:

Field Documentation

◆ $migration_account

ilAuthProviderShibboleth::$migration_account = ''
private

Definition at line 23 of file class.ilAuthProviderShibboleth.php.


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