Skip to content
This repository was archived by the owner on Sep 19, 2022. It is now read-only.

Commit 5b0e9c7

Browse files
committed
Fixed the bug with filling attribute isCesnetEligibleLastSeen
* Fixed the bug, that attribute isCesnetEligibleLastSeen wasn't filled for Hostel Idp
1 parent 3c53369 commit 5b0e9c7

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file.
44
## [Unreleased]
55
[Changed]
66
- Fixed the filter for isCesnetEligibleLastSeen that checks the eduPersonScopedAffiliations
7+
- Fixed the bug, that attribute isCesnetEligibleLastSeen wasn't filled for Hostel Idp
78

89
## [v1.1.1]
910
[Changed]

lib/Auth/Process/IsCesnetEligible.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ class sspmod_cesnet_Auth_Process_IsCesnetEligible extends SimpleSAML_Auth_Proces
1616
const OTHER = "other";
1717
const EDUID_IDP_GROUP = "http://eduid.cz/uri/idp-group/";
1818

19+
const HOSTEL_ENTITY_ID = "https://idp.hostel.eduid.cz/idp/shibboleth";
20+
1921
const INTERFACE_PROPNAME = "interface";
2022
const CESNET_ELIGIBLE_LAST_SEEN_ATTR = "cesnetEligibleLastSeenAttr";
2123
const DEFAULT_ATTR_NAME = 'isCesnetEligibleLastSeen';
@@ -74,13 +76,21 @@ public function process(&$request)
7476
}
7577
}
7678

79+
$isHostelVerified = false;
80+
if ($request['saml:sp:IdP'] === self::HOSTEL_ENTITY_ID && isset($request['Attributes']['loa'])
81+
&& $request['Attributes']['loa'][0] == 2) {
82+
$isHostelVerified = true;
83+
SimpleSAML\Logger::debug("cesnet:IsCesnetEligible - The user was verified by Hostel.");
84+
}
85+
7786
try {
7887
$this->cesnetEligibleLastSeen = sspmod_perun_RpcConnector::get('attributesManager', 'getAttribute', array(
7988
'user' => $user->getId(),
8089
'attributeName' => $this->cesnetEligibleLastSeenAttr,
8190
));
8291

83-
if (!empty($this->eduPersonScopedAffiliation) && !is_null($this->entityCategory) && $this->isCesnetEligible()) {
92+
if ((!empty($this->eduPersonScopedAffiliation) && !is_null($this->entityCategory) && $this->isCesnetEligible())
93+
|| $isHostelVerified) {
8494
$this->cesnetEligibleLastSeen['value'] = date("Y-m-d H:i:s");
8595
sspmod_perun_RpcConnector::post('attributesManager', 'setAttribute', array(
8696
'user' => $user->getId(),

0 commit comments

Comments
 (0)