generated from Firehed/php-library-template
-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathChallengeManagerInterface.php
More file actions
33 lines (29 loc) · 1.04 KB
/
ChallengeManagerInterface.php
File metadata and controls
33 lines (29 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
declare(strict_types=1);
namespace Firehed\WebAuthn;
interface ChallengeManagerInterface
{
/**
* Generates a new Challenge, stores it in the backing mechanism, and
* returns it.
*
* @api
*/
public function createChallenge(): ChallengeInterface;
/**
* Consumes the challenge associated with the ClientDataJSON value from the
* underlying storage mechanism, and returns that challenge if found.
*
* Implementations MUST ensure that subsequent calls to this method with
* the same value return `null`, regardless of whether the initial call
* returned a value or null. Failure to do so will compromise the security
* of the webauthn protocol.
*
* Implementations MUST NOT use the ClientDataJSON value to construct
* a challenge. They MUST return a previously-stored value if one is found,
* and MAY use $base64Url to search the storage mechanism.
*
* @internal
*/
public function useFromClientDataJSON(string $base64Url): ?ChallengeInterface;
}