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

Commit 2da290d

Browse files
melangervyskocilpavel
authored andcommitted
Take service name in listOfSps from an attribute
1 parent 58f229a commit 2da290d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

www/listOfSps.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
const ATTRIBUTES_DEFINITIONS = 'listOfSps.attributesDefinitions';
1212
const SHOW_OIDC_SERVICES = 'listOfSps.showOIDCServices';
1313

14+
const PERUN_SERVICE_NAME_ATTR_NAME = 'listOfSps.serviceNameAttr';
1415
const PERUN_PROXY_IDENTIFIER_ATTR_NAME = 'listOfSps.perunProxyIdentifierAttr';
1516
const PERUN_LOGIN_URL_ATTR_NAME = 'listOfSps.loginURLAttr';
1617
const PERUN_TEST_SP_ATTR_NAME = 'listOfSps.isTestSpAttr';
@@ -62,6 +63,7 @@
6263
);
6364
}
6465

66+
$perunServiceNameAttr = $conf->getString(PERUN_SERVICE_NAME_ATTR_NAME, 'urn:perun:facility:attribute-def:core:name');
6567
$perunLoginURLAttr = $conf->getString(PERUN_LOGIN_URL_ATTR_NAME, null);
6668
$perunTestSpAttr = $conf->getString(PERUN_TEST_SP_ATTR_NAME, null);
6769
$perunShowOnServiceListAttr
@@ -76,6 +78,7 @@
7678
$attrNames = [];
7779

7880
array_push($attrNames, $perunSaml2EntityIdAttr);
81+
array_push($attrNames, $perunServiceNameAttr);
7982
if (!empty($perunOidcClientIdAttr)) {
8083
array_push($attrNames, $perunOidcClientIdAttr);
8184
}
@@ -161,7 +164,7 @@
161164
$json['statistics']['oidcTestServicesCount'] = $statistics['oidcTestServicesCount'];
162165
foreach ($allServices as $service) {
163166
$a = [];
164-
$a['name'] = $service['facility']->getName();
167+
$a['name'] = $service['facilityAttributes'][$perunServiceNameAttr]['value'];
165168

166169
if (array_key_exists($service['facility']->getID(), $samlServices)) {
167170
$a['authenticationProtocol'] = 'SAML';

0 commit comments

Comments
 (0)