@@ -16,6 +16,8 @@ class sspmod_cesnet_Auth_Process_IsCesnetEligible extends SimpleSAML_Auth_Proces
16
16
const OTHER = "other " ;
17
17
const EDUID_IDP_GROUP = "http://eduid.cz/uri/idp-group/ " ;
18
18
19
+ const HOSTEL_ENTITY_ID = "https://idp.hostel.eduid.cz/idp/shibboleth " ;
20
+
19
21
const INTERFACE_PROPNAME = "interface " ;
20
22
const CESNET_ELIGIBLE_LAST_SEEN_ATTR = "cesnetEligibleLastSeenAttr " ;
21
23
const DEFAULT_ATTR_NAME = 'isCesnetEligibleLastSeen ' ;
@@ -74,13 +76,21 @@ public function process(&$request)
74
76
}
75
77
}
76
78
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
+
77
86
try {
78
87
$ this ->cesnetEligibleLastSeen = sspmod_perun_RpcConnector::get ('attributesManager ' , 'getAttribute ' , array (
79
88
'user ' => $ user ->getId (),
80
89
'attributeName ' => $ this ->cesnetEligibleLastSeenAttr ,
81
90
));
82
91
83
- if (!empty ($ this ->eduPersonScopedAffiliation ) && !is_null ($ this ->entityCategory ) && $ this ->isCesnetEligible ()) {
92
+ if ((!empty ($ this ->eduPersonScopedAffiliation ) && !is_null ($ this ->entityCategory ) && $ this ->isCesnetEligible ())
93
+ || $ isHostelVerified ) {
84
94
$ this ->cesnetEligibleLastSeen ['value ' ] = date ("Y-m-d H:i:s " );
85
95
sspmod_perun_RpcConnector::post ('attributesManager ' , 'setAttribute ' , array (
86
96
'user ' => $ user ->getId (),
0 commit comments