Passed
Push — master ( f07e2d...f5be48 )
by Stefan
11:00 queued 08:45
created

Supercharged::authenticate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 6
rs 10
1
<?php
2
3
/**
4
 * FIDO2 Passwordless authentication source.
5
 *
6
 * @package simplesamlphp/simplesamlphp-module-webauthn
7
 */
8
9
declare(strict_types=1);
10
11
namespace SimpleSAML\Module\webauthn\Auth\Source;
12
13
use SimpleSAML\Assert\Assert;
14
use SimpleSAML\Auth\Source;
15
use SimpleSAML\Configuration;
16
use SimpleSAML\Error;
17
use SimpleSAML\Logger;
18
use SimpleSAML\Module\webauthn\WebAuthn\StateData;
19
use SimpleSAML\Module\webauthn\WebAuthn\StaticProcessHelper;
20
use SimpleSAML\Module\webauthn\Controller\WebAuthn;
21
22
class Supercharged extends Passwordless
23
{
24
25
    public function __construct(array $info, array $config)
26
    {
27
        parent::__construct($info, $config);
28
    }
29
    public function authenticate(array &$state): void
30
    {
31
        $state['saml:AuthnContextClassRef'] = $this->authnContextClassRef;
32
33
        StaticProcessHelper::prepareStatePasswordlessAuth($this->stateData, $state);
34
        StaticProcessHelper::saveStateAndRedirectSupercharged($state);
35
    }
36
37
}
38