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

Commit dcfaf6c

Browse files
committed
Added support for MFA
1 parent cbdab3d commit dcfaf6c

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

CHANGELOG.md

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

44
## [Unreleased]
5+
[Added]
6+
- Added support for MFA
57

68
## [v1.2.2]
79
[Removed]

themes/elixir/perun/disco-tpl.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,15 @@
2323
const WARNING_TITLE = 'title';
2424
const WARNING_TEXT = 'text';
2525

26+
const MFA_IDENTIFIER = "https://refeds.org/profile/mfa";
27+
const MFA_IDP = "https://stepup.elixir-finland.org/idp/shibboleth";
28+
2629
$warningIsOn = false;
2730
$warningUserCanContinue = null;
2831
$warningTitle = null;
2932
$warningText = null;
3033
$config = null;
34+
$authContextClassRef = null;
3135

3236
try {
3337
$config = SimpleSAML_Configuration::getConfig(WARNING_CONFIG_FILE_NAME);
@@ -68,8 +72,22 @@
6872
$this->data['header'] = $this->t('{elixir:elixir:warning}');
6973
}
7074

75+
if (isset($this->data['AuthnContextClassRef'])) {
76+
$authContextClassRef = $this->data['AuthnContextClassRef'];
77+
}
78+
7179
$this->includeAtTemplateBase('includes/header.php');
7280

81+
if ($authContextClassRef != null) {
82+
foreach ($authContextClassRef as $value) {
83+
if (substr($value, 0, strlen(MFA_IDENTIFIER)) === MFA_IDENTIFIER) {
84+
SimpleSAML\Logger::info("Redirecting to " . MFA_IDP);
85+
$url = $this->getContinueUrl(MFA_IDP);
86+
SimpleSAML\Utils\HTTP::redirectTrustedURL($url);
87+
exit;
88+
}
89+
}
90+
}
7391

7492
if ($warningIsOn) {
7593
if($warningUserCanContinue) {

0 commit comments

Comments
 (0)