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

Commit 9dc55dc

Browse files
committed
Added hack solving an issue with EBI IdP which started to release the eppn.
1 parent bf02770 commit 9dc55dc

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/Auth/Process/ProcessTargetedID.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,12 @@ public function process(&$request)
7777
# Set uid and also eduPersonPrincipalName, so all the modules and Perun will be happy
7878
$request['Attributes'][$this->uidAttr] = array($newEduPersonPrincipalName);
7979
# TODO line below must be removed after ELIXIR will be switched to default behaviour, so Perun will consume original eppn and entityID
80-
$request['Attributes']['eduPersonPrincipalName'] = array($newEduPersonPrincipalName);
81-
80+
if (!isset($request['Attributes']['eduPersonPrincipalName']) || empty($request['Attributes']['eduPersonPrincipalName'])) {
81+
$request['Attributes']['eduPersonPrincipalName'] = array($newEduPersonPrincipalName);
82+
}
83+
# TODO Temporary hack when users from EBI will have targetedID in edupersonprincial name, so Perun can recognise them. They have just eptid in Perun. We need to add storing eppn and epuid to Perun on each request and also Perun needs to search users based on all three attributes eppn, epuid and eptid, not just via REMOTE_USER
84+
if (isset($request['Attributes']['eduPersonPrincipalName']) && strrpos($request['Attributes']['eduPersonPrincipalName'][0], '@ebi.ac.uk') !== false) {
85+
$request['Attributes']['eduPersonPrincipalName'] = array($newEduPersonPrincipalName);
86+
}
8287
}
83-
8488
}

0 commit comments

Comments
 (0)