1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* Copyright 2025 SURFnet bv |
5
|
|
|
* |
6
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
7
|
|
|
* you may not use this file except in compliance with the License. |
8
|
|
|
* You may obtain a copy of the License at |
9
|
|
|
* |
10
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0 |
11
|
|
|
* |
12
|
|
|
* Unless required by applicable law or agreed to in writing, software |
13
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, |
14
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
15
|
|
|
* See the License for the specific language governing permissions and |
16
|
|
|
* limitations under the License. |
17
|
|
|
*/ |
18
|
|
|
|
19
|
|
|
namespace Surfnet\StepupGateway\SecondFactorOnlyBundle\Service\Gateway; |
20
|
|
|
|
21
|
|
|
use Surfnet\StepupGateway\GatewayBundle\Service\SecondFactor\SecondFactorInterface; |
22
|
|
|
|
23
|
|
|
class SecondfactorGsspFallback implements SecondFactorInterface |
24
|
|
|
{ |
25
|
|
|
private string $subject; |
26
|
|
|
private string $institution; |
27
|
|
|
private string $secondFactorType; |
28
|
|
|
private string $displayLocale; |
29
|
|
|
public const SECOND_FACTOR_ID = 'gssp_fallback'; |
30
|
|
|
|
31
|
|
|
private function __construct(string $subject, string $institution, string $secondFactorType, string $displayLocale) |
32
|
|
|
{ |
33
|
|
|
$this->secondFactorType = $secondFactorType; |
34
|
|
|
$this->displayLocale = $displayLocale; |
35
|
|
|
$this->subject = $subject; |
36
|
|
|
$this->institution = $institution; |
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
public static function create(string $subject, string $institution, string $type, string $displayLocale) |
40
|
|
|
{ |
41
|
|
|
return new self($subject, $institution, $type, $displayLocale); |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
public function getSecondFactorId(): string |
45
|
|
|
{ |
46
|
|
|
return self::SECOND_FACTOR_ID; |
47
|
|
|
} |
48
|
|
|
|
49
|
|
|
public function getSecondFactorType(): string |
50
|
|
|
{ |
51
|
|
|
return $this->secondFactorType; |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
public function getDisplayLocale(): string |
55
|
|
|
{ |
56
|
|
|
return $this->displayLocale; |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
public function getSecondFactorIdentifier(): string |
60
|
|
|
{ |
61
|
|
|
return $this->subject; |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
public function getInstitution(): string |
65
|
|
|
{ |
66
|
|
|
return $this->institution; |
67
|
|
|
} |
68
|
|
|
} |
69
|
|
|
|