ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 ()
 
 doAuthentication (\ilAuthStatus $status)
 Do authentication. More...
 

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 }

References ilAuthProvider\$credentials.

Member Function Documentation

◆ doAuthentication()

ilAuthProviderShibboleth::doAuthentication ( \ilAuthStatus  $status)

Do apache auth.

Parameters
\ilAuthStatus$status

Implements ilAuthProviderInterface.

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

40 {
41 global $DIC; // for backword compatibility of hook environment variables
42 $ilias = $DIC['ilias'];
43 $ilSetting = $DIC['ilSetting'];
44 $shibServerData = shibServerData::getInstance();
45
46 //$this->getLogger()->dump($shibServerData);
47
48 if ($shibServerData->getLogin()) {
49 $shibUser = shibUser::buildInstance($shibServerData);
50 // for backword compatibility of hook environment variables
51 $userObj = &$shibUser; // For shib_data_conv included Script
52 $newUser = $shibUser->isNew(); // For shib_data_conv included Script
53 if ($shibUser->isNew()) {
54 $shibUser->createFields();
55 $shibUser->setPref('hits_per_page', $ilSetting->get('hits_per_page'));
56
57 // Modify user data before creating the user
58 // Include custom code that can be used to further modify
59 // certain Shibboleth user attributes
60 if ($ilias->getSetting('shib_data_conv') and $ilias->getSetting('shib_data_conv') != ''
61 and is_readable($ilias->getSetting('shib_data_conv'))
62 ) {
63 include($ilias->getSetting('shib_data_conv'));
64 }
65 $shibUser = ilShibbolethPluginWrapper::getInstance()->beforeCreateUser($shibUser);
66 $shibUser->create();
67 $shibUser->updateOwner();
68 $shibUser->saveAsNew();
69 $shibUser->writePrefs();
70 $shibUser = ilShibbolethPluginWrapper::getInstance()->afterCreateUser($shibUser);
72 } else {
73 $shibUser->updateFields();
74 // Include custom code that can be used to further modify
75 // certain Shibboleth user attributes
76 if ($ilias->getSetting('shib_data_conv') and $ilias->getSetting('shib_data_conv') != ''
77 and is_readable($ilias->getSetting('shib_data_conv'))
78 ) {
79 include($ilias->getSetting('shib_data_conv'));
80 }
81 // $shibUser->update();
82 $shibUser = ilShibbolethPluginWrapper::getInstance()->beforeUpdateUser($shibUser);
83 $shibUser->update();
84 $shibUser = ilShibbolethPluginWrapper::getInstance()->afterUpdateUser($shibUser);
86 }
87
89 if (($newUser && !$c->isActivateNew()) || !$newUser) {
91 $status->setAuthenticatedUserId(ilObjUser::_lookupId($shibUser->getLogin()));
92 } elseif ($newUser && $c->isActivateNew()) {
94 $status->setReason('err_inactive');
95 }
96 } else {
97 $this->getLogger()->info('Shibboleth authentication failed.');
98 $this->handleAuthenticationFail($status, 'err_wrong_login');
99 return false;
100 }
101 }
getLogger()
Get logger.
handleAuthenticationFail(ilAuthStatus $status, $a_reason)
Handle failed authentication.
const STATUS_AUTHENTICATION_FAILED
static _lookupId($a_user_str)
Lookup id by login.
static getInstance()
static buildInstance(shibServerData $shibServerData)
global $ilSetting
Definition: privfeed.php:17
global $DIC
Definition: saml.php:7
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']

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

+ 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: