Compare commits
2 Commits
44ff0a94ad
...
1.2.3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cfab865c1d | ||
| b421096758 |
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "laragear/webauthn",
|
"name": "kletellier/webauthn",
|
||||||
"description": "Authenticate users with Passkeys: fingerprints, patterns and biometric data.",
|
"description": "Authenticate users with Passkeys: fingerprints, patterns and biometric data.",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -25,6 +25,11 @@
|
|||||||
"email": "DarkGhostHunter@Gmail.com",
|
"email": "DarkGhostHunter@Gmail.com",
|
||||||
"role": "Developer",
|
"role": "Developer",
|
||||||
"homepage": "https://github.com/sponsors/DarkGhostHunter"
|
"homepage": "https://github.com/sponsors/DarkGhostHunter"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Gregory Letellier",
|
||||||
|
"email": "register@gletellier.com",
|
||||||
|
"role": "Developer"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
|
|||||||
@@ -269,7 +269,7 @@ class WebAuthn {
|
|||||||
]
|
]
|
||||||
.filter(key => key in credentials.response)
|
.filter(key => key in credentials.response)
|
||||||
.forEach(key => parseCredentials.response[key] = WebAuthn.#arrayToBase64String(credentials.response[key]));
|
.forEach(key => parseCredentials.response[key] = WebAuthn.#arrayToBase64String(credentials.response[key]));
|
||||||
|
parseCredentials.response['userId'] = credentials.id;
|
||||||
return parseCredentials;
|
return parseCredentials;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ class AddConfiguration
|
|||||||
public function handle(AssertionCreation $assertion, Closure $next): mixed
|
public function handle(AssertionCreation $assertion, Closure $next): mixed
|
||||||
{
|
{
|
||||||
$assertion->json->set('timeout', $this->config->get('webauthn.challenge.timeout') * 1000);
|
$assertion->json->set('timeout', $this->config->get('webauthn.challenge.timeout') * 1000);
|
||||||
|
$assertion->json->set('hints', ['security-key']); // Force security proposal for windows 10 and prevent Windows Hello
|
||||||
return $next($assertion);
|
return $next($assertion);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,6 +71,11 @@ class CheckCredentialIsForUser
|
|||||||
protected function validateId(AssertionValidation $validation): void
|
protected function validateId(AssertionValidation $validation): void
|
||||||
{
|
{
|
||||||
$handle = $validation->request->json('response.userHandle');
|
$handle = $validation->request->json('response.userHandle');
|
||||||
|
$userId = $validation->request->json('response.userId');
|
||||||
|
|
||||||
|
if(! $handle && $userId) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (! $handle || ! hash_equals(Uuid::fromString($validation->credential->user_id)->getHex()->toString(), $handle)) {
|
if (! $handle || ! hash_equals(Uuid::fromString($validation->credential->user_id)->getHex()->toString(), $handle)) {
|
||||||
throw AssertionException::make('User ID is not owner of the stored credential.');
|
throw AssertionException::make('User ID is not owner of the stored credential.');
|
||||||
|
|||||||
Reference in New Issue
Block a user