Skip to content

Commit

Permalink
Update code to reflect the new EGI checkin error message
Browse files Browse the repository at this point in the history
  • Loading branch information
Sae126V committed Aug 6, 2024
1 parent bfcc1bc commit bb3414d
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions lib/Authentication/AuthTokens/ShibAuthToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ private function getAttributesInitToken(){
}
if(empty($_SERVER['entitlement'])){
//die('Did not recieve the required entitlement attribute from the EGI Proxy IdP, please contact gocdb-admins');
$HTML = '<ul><li>Login requires a GOCDB entitlement value <a href="https://wiki.egi.eu/wiki/URN_Registry:aai.egi.eu:gocdb" target="_blank">https://wiki.egi.eu/wiki/URN_Registry:aai.egi.eu:gocdb</a></li><li>Please, logout or restart your browser and attempt to login again using an identity provider that provides a GOCDB entitlement</li></ul>';
$HTML = $this->getEntitlementErrorMessage();
$HTML .= "<div style='text-align: center;'>";
$HTML .= '<a href="'.htmlspecialchars(\Factory::$properties['LOGOUTURL']).'"><b><font colour="red">Logout</font></b></a>';
$HTML .= "</div>";
Expand All @@ -132,7 +132,7 @@ private function getAttributesInitToken(){

$entitlementValuesArray = explode(';', $_SERVER['entitlement']);
if( !in_array('urn:mace:egi.eu:res:gocdb#aai.egi.eu', $entitlementValuesArray) ){
$HTML = '<ul><li>Login requires a GOCDB entitlement <a href="https://wiki.egi.eu/wiki/URN_Registry:aai.egi.eu:gocdb" target="_blank">https://wiki.egi.eu/wiki/URN_Registry:aai.egi.eu:gocdb</a></li><li>Please, logout or restart your browser and attempt to login again using an identity provider that provides a GOCDB entitlement</li></ul>';
$HTML = $this->getEntitlementErrorMessage();
$HTML .= "<div style='text-align: center;'>";
$HTML .= '<a href="'.htmlspecialchars(\Factory::$properties['LOGOUTURL']).'"><b><font colour="red">Logout</font></b></a>';
$HTML .= "</div>";
Expand Down Expand Up @@ -204,4 +204,21 @@ public static function isStateless() {
return true;
}

private function getEntitlementErrorMessage()
{
$resourceLink = "https://docs.egi.eu/internal/configuration-database";
$sectionFragmentInfo = "/access/#using-institutional-account-via-egi-check-in";
$documentationURL = $resourceLink . $sectionFragmentInfo;

return '<ul>'
.'<li>Login requires the entitlement "urn:mace:egi.eu:res:gocdb#aai.egi.eu", '
. 'which was not provided. This entitlement is automatically granted when using '
. 'an identity provider compliant with '
. '<a href="https://refeds.org/category/research-and-scholarship" target="_blank">REFEDS R&amp;S</a> '
. 'and <a href="https://refeds.org/sirtfi" target="_blank">REFEDS Sirtfi</a>. '
. 'Please see here for more information: '
. '<a href="' . $documentationURL . 'target="_blank">' . $documentationURL . '</a>.'
. '</li>'
. '</ul>';
}
}

0 comments on commit bb3414d

Please sign in to comment.