Total Complexity | 2 |
Total Lines | 37 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
26 | final readonly class TestAuthenticationRequestFactory |
||
27 | { |
||
28 | public function __construct(private ServiceProvider $serviceProvider, private IdentityProvider $identityProvider) |
||
29 | { |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * |
||
34 | * @return \Surfnet\SamlBundle\SAML2\AuthnRequest |
||
35 | */ |
||
36 | public function createSecondFactorTestRequest(string $nameId, Loa $loa) |
||
37 | { |
||
38 | $authenticationRequest = AuthnRequestFactory::createNewRequest( |
||
39 | $this->serviceProvider, |
||
40 | $this->identityProvider |
||
41 | ); |
||
42 | |||
43 | $authenticationRequest->setSubject($nameId); |
||
44 | $authenticationRequest->setAuthenticationContextClassRef((string) $loa); |
||
45 | |||
46 | return $authenticationRequest; |
||
47 | } |
||
48 | } |
||
49 |