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

Commit 7b0f8a7

Browse files
committed
New attr in PerunIdentity filter with list of SPs identifier's
* Added new atribute in PerunIdentity process filter with list of Services identifier's for which we don't want to show page with information, that the user will be redirected to other page
1 parent 3d5da36 commit 7b0f8a7

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
All notable changes to this project will be documented in this file.
33

44
## [Unreleased]
5+
[Added]
6+
- Added new atribute in PerunIdentity process filter with list of Services identifier's for which we don't want to show page with information, that the user will be redirected to other page
7+
58
[Changed]
69
- Changed design of ListOfSps
710

lib/Auth/Process/PerunIdentity.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ class sspmod_perun_Auth_Process_PerunIdentity extends SimpleSAML_Auth_Processing
3939
const PERUN_FACILITY_DYNAMIC_REGISTRATION_ATTR= 'facilityDynamicRegistrationAttr';
4040
const PERUN_FACILITY_REGISTER_URL_ATTR = 'facilityRegisterUrlAttr';
4141
const PERUN_FACILITY_ALLOW_REGISTRATION_TO_GROUPS = 'facilityAllowRegistrationToGroups';
42+
const LIST_OF_SPS_WITHOUT_INFO_ABOUT_REDIRECTION = 'listOfSpsWithoutInfoAboutRedirection';
4243

4344

4445
private $uidsAttr;
@@ -47,6 +48,7 @@ class sspmod_perun_Auth_Process_PerunIdentity extends SimpleSAML_Auth_Processing
4748
private $defaultRegisterUrl;
4849
private $voShortName;
4950
private $facilityVoShortNames = array();
51+
private $listOfSpsWithoutInfoAboutRedirection = array();
5052
private $spEntityId;
5153
private $interface;
5254
private $checkGroupMembership = false;
@@ -112,7 +114,9 @@ public function __construct($config, $reserved)
112114
if (!isset($config[self::FORCE_REGISTRATION_TO_GROUPS])) {
113115
$config[self::FORCE_REGISTRATION_TO_GROUPS] = false;
114116
}
115-
117+
if (isset($config[self::LIST_OF_SPS_WITHOUT_INFO_ABOUT_REDIRECTION]) && is_array($config[self::LIST_OF_SPS_WITHOUT_INFO_ABOUT_REDIRECTION])) {
118+
$this->listOfSpsWithoutInfoAboutRedirection = $config[self::LIST_OF_SPS_WITHOUT_INFO_ABOUT_REDIRECTION];
119+
}
116120
$this->uidsAttr = $config[self::UIDS_ATTR];
117121
$this->registerUrlBase = (string) $config[self::REGISTER_URL_BASE];
118122
$this->defaultRegisterUrl = (string) $config[self::REGISTER_URL];
@@ -264,6 +268,11 @@ protected function registerDirectly($request, $callback, $registerUrL, $vo = nul
264268
$params[self::TARGET_EXTENDED] = $callback;
265269

266270
$id = SimpleSAML_Auth_State::saveState($request, 'perun:PerunIdentity');
271+
272+
if (in_array($this->spEntityId, $this->listOfSpsWithoutInfoAboutRedirection)) {
273+
\SimpleSAML\Utils\HTTP::redirectTrustedURL($registerUrL, $params);
274+
}
275+
267276
$url = SimpleSAML\Module::getModuleURL('perun/unauthorized_access_go_to_registration.php');
268277
\SimpleSAML\Utils\HTTP::redirectTrustedURL($url, array(
269278
'StateId' => $id,

0 commit comments

Comments
 (0)