Skip to content
Snippets Groups Projects
Unverified Commit 87c92b45 authored by Michal Procházka's avatar Michal Procházka Committed by GitHub
Browse files

Merge pull request #6 from pajavyskocil/idpEntityIDFilter

Added support for pass selected IdP from SP
parents d8a3c36b f075e2f8
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,13 @@ ...@@ -2,6 +2,13 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
## [Unreleased] ## [Unreleased]
[Added]
- Added support for pass selected IdP from SP in AuthnContextClassRef attribute.
- It's required add this line into module_perun.php config file
<pre>
'disco.removeAuthnContextClassRefPrefix' => 'urn:cesnet:proxyidp:',
</pre>
[Changed] [Changed]
- Social Idps are not shown when adding institution - Social Idps are not shown when adding institution
......
...@@ -23,6 +23,11 @@ const WARNING_USER_CAN_CONTINUE = 'userCanContinue'; ...@@ -23,6 +23,11 @@ const WARNING_USER_CAN_CONTINUE = 'userCanContinue';
const WARNING_TITLE = 'title'; const WARNING_TITLE = 'title';
const WARNING_TEXT = 'text'; const WARNING_TEXT = 'text';
const URN_CESNET_PROXYIDP_IDPENTITYID = "urn:cesnet:proxyidp:idpentityid:";
$authContextClassRef = null;
$idpEntityId = null;
$warningIsOn = false; $warningIsOn = false;
$warningUserCanContinue = null; $warningUserCanContinue = null;
$warningTitle = null; $warningTitle = null;
...@@ -63,6 +68,10 @@ if ($warningIsOn) { ...@@ -63,6 +68,10 @@ if ($warningIsOn) {
} }
} }
if (isset($this->data['AuthnContextClassRef'])) {
$authContextClassRef = $this->data['AuthnContextClassRef'];
}
# Do not show social IdPs when using addInstitutionApp, show just header Add Institution # Do not show social IdPs when using addInstitutionApp, show just header Add Institution
if ($this->isAddInstitutionApp()) { if ($this->isAddInstitutionApp()) {
// Translate title in header // Translate title in header
...@@ -77,6 +86,18 @@ if ($this->isAddInstitutionApp()) { ...@@ -77,6 +86,18 @@ if ($this->isAddInstitutionApp()) {
$this->includeAtTemplateBase('includes/header.php'); $this->includeAtTemplateBase('includes/header.php');
if ($authContextClassRef != null) {
foreach ($authContextClassRef as $value) {
if (substr($value, 0, strlen(URN_CESNET_PROXYIDP_IDPENTITYID)) === URN_CESNET_PROXYIDP_IDPENTITYID) {
$idpEntityId = substr($value, strlen(URN_CESNET_PROXYIDP_IDPENTITYID), strlen($value));
SimpleSAML\Logger::info("Redirecting to " . $idpEntityId);
$url = $this->getContinueUrl($idpEntityId);
SimpleSAML\Utils\HTTP::redirectTrustedURL($url);
exit;
}
}
}
if ($warningIsOn) { if ($warningIsOn) {
if ($warningUserCanContinue) { if ($warningUserCanContinue) {
echo '<div class="alert alert-warning">'; echo '<div class="alert alert-warning">';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment