Supercharged::authenticate()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 7
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\Module\webauthn\WebAuthn\StaticProcessHelper;
14
15
class Supercharged extends Passwordless
16
{
17
    /**
18
     * The AuthSource to use when someone enters a username/password
19
     *
20
     * @var string
21
     */
22
    private $pushbackAuthsource;
23
24
    public function __construct(array $info, array $config)
25
    {
26
        parent::__construct($info, $config);
27
28
        $this->pushbackAuthsource = $this->authSourceConfig->getString("password_authsource");
29
    }
30
31
    public function authenticate(array &$state): void
32
    {
33
        $state['saml:AuthnContextClassRef'] = $this->authnContextClassRef;
34
        $state['pushbackAuthsource'] = $this->pushbackAuthsource;
35
36
        StaticProcessHelper::prepareStatePasswordlessAuth($this->stateData, $state);
37
        StaticProcessHelper::saveStateAndRedirectSupercharged($state);
38
    }
39
}
40