Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
fusiondirectory
WebAuthn
Commits
6599699d
Commit
6599699d
authored
5 years ago
by
Lukas Buchs
Browse files
Options
Download
Patches
Plain Diff
getGetArgs: parameter requireUserVerification
parent
a0d0fa41
master
v2.0.0-beta
v1.1.3
v1.1.2
v1.1.1
v1.1.0
v1.0.0
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
WebAuthn.php
+26
-8
WebAuthn.php
with
26 additions
and
8 deletions
+26
-8
WebAuthn.php
+
26
−
8
View file @
6599699d
...
...
@@ -107,13 +107,6 @@ class WebAuthn {
* @return \stdClass
*/
public
function
getCreateArgs
(
$userId
,
$userName
,
$userDisplayName
,
$timeout
=
20
,
$requireResidentKey
=
false
,
$requireUserVerification
=
false
,
$excludeCredentialIds
=
array
())
{
$args
=
new
\
stdClass
();
$args
->
publicKey
=
new
\
stdClass
();
// relying party
$args
->
publicKey
->
rp
=
new
\
stdClass
();
$args
->
publicKey
->
rp
->
name
=
$this
->
_rpName
;
$args
->
publicKey
->
rp
->
id
=
$this
->
_rpId
;
// validate User Verification Requirement
if
(
\
is_bool
(
$requireUserVerification
))
{
...
...
@@ -124,6 +117,14 @@ class WebAuthn {
$requireUserVerification
=
'preferred'
;
}
$args
=
new
\
stdClass
();
$args
->
publicKey
=
new
\
stdClass
();
// relying party
$args
->
publicKey
->
rp
=
new
\
stdClass
();
$args
->
publicKey
->
rp
->
name
=
$this
->
_rpName
;
$args
->
publicKey
->
rp
->
id
=
$this
->
_rpId
;
$args
->
publicKey
->
authenticatorSelection
=
new
\
stdClass
();
$args
->
publicKey
->
authenticatorSelection
->
userVerification
=
$requireUserVerification
;
if
(
$requireResidentKey
)
{
...
...
@@ -174,13 +175,30 @@ class WebAuthn {
* @param bool $allowNfc allow Near Field Communication (NFC)
* @param bool $allowBle allow Bluetooth
* @param bool $allowInternal allow client device-specific transport. These authenticators are not removable from the client device.
* @param bool|string $requireUserVerification indicates that you require user verification and will fail the operation
* if the response does not have the UV flag set.
* Valid values:
* true = required
* false = preferred
* string 'required' 'preferred' 'discouraged'
* @return \stdClass
*/
public
function
getGetArgs
(
$credentialIds
=
array
(),
$timeout
=
20
,
$allowUsb
=
true
,
$allowNfc
=
true
,
$allowBle
=
true
,
$allowInternal
=
true
)
{
public
function
getGetArgs
(
$credentialIds
=
array
(),
$timeout
=
20
,
$allowUsb
=
true
,
$allowNfc
=
true
,
$allowBle
=
true
,
$allowInternal
=
true
,
$requireUserVerification
=
false
)
{
// validate User Verification Requirement
if
(
\
is_bool
(
$requireUserVerification
))
{
$requireUserVerification
=
$requireUserVerification
?
'required'
:
'preferred'
;
}
else
if
(
\
is_string
(
$requireUserVerification
)
&&
\
in_array
(
\
strtolower
(
$requireUserVerification
),
[
'required'
,
'preferred'
,
'discouraged'
]))
{
$requireUserVerification
=
\
strtolower
(
$requireUserVerification
);
}
else
{
$requireUserVerification
=
'preferred'
;
}
$args
=
new
\
stdClass
();
$args
->
publicKey
=
new
\
stdClass
();
$args
->
publicKey
->
timeout
=
$timeout
*
1000
;
// microseconds
$args
->
publicKey
->
challenge
=
$this
->
_createChallenge
();
// binary
$args
->
publicKey
->
userVerification
=
$requireUserVerification
;
if
(
\
is_array
(
$credentialIds
)
&&
\
count
(
$credentialIds
)
>
0
)
{
$args
->
publicKey
->
allowCredentials
=
array
();
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets