Skip to content
Snippets Groups Projects
Unverified Commit dcfaf6c8 authored by Pavel Vyskočil's avatar Pavel Vyskočil
Browse files

Added support for MFA

parent cbdab3d5
Branches
Tags
No related merge requests found
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
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 MFA
## [v1.2.2] ## [v1.2.2]
[Removed] [Removed]
......
...@@ -23,11 +23,15 @@ const WARNING_USER_CAN_CONTINUE = 'userCanContinue'; ...@@ -23,11 +23,15 @@ const WARNING_USER_CAN_CONTINUE = 'userCanContinue';
const WARNING_TITLE = 'title'; const WARNING_TITLE = 'title';
const WARNING_TEXT = 'text'; const WARNING_TEXT = 'text';
const MFA_IDENTIFIER = "https://refeds.org/profile/mfa";
const MFA_IDP = "https://stepup.elixir-finland.org/idp/shibboleth";
$warningIsOn = false; $warningIsOn = false;
$warningUserCanContinue = null; $warningUserCanContinue = null;
$warningTitle = null; $warningTitle = null;
$warningText = null; $warningText = null;
$config = null; $config = null;
$authContextClassRef = null;
try { try {
$config = SimpleSAML_Configuration::getConfig(WARNING_CONFIG_FILE_NAME); $config = SimpleSAML_Configuration::getConfig(WARNING_CONFIG_FILE_NAME);
...@@ -68,8 +72,22 @@ if ($warningIsOn && !$warningUserCanContinue) { ...@@ -68,8 +72,22 @@ if ($warningIsOn && !$warningUserCanContinue) {
$this->data['header'] = $this->t('{elixir:elixir:warning}'); $this->data['header'] = $this->t('{elixir:elixir:warning}');
} }
if (isset($this->data['AuthnContextClassRef'])) {
$authContextClassRef = $this->data['AuthnContextClassRef'];
}
$this->includeAtTemplateBase('includes/header.php'); $this->includeAtTemplateBase('includes/header.php');
if ($authContextClassRef != null) {
foreach ($authContextClassRef as $value) {
if (substr($value, 0, strlen(MFA_IDENTIFIER)) === MFA_IDENTIFIER) {
SimpleSAML\Logger::info("Redirecting to " . MFA_IDP);
$url = $this->getContinueUrl(MFA_IDP);
SimpleSAML\Utils\HTTP::redirectTrustedURL($url);
exit;
}
}
}
if ($warningIsOn) { if ($warningIsOn) {
if($warningUserCanContinue) { if($warningUserCanContinue) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment