add fido2 android support by including cids
parent
c11b6557db
commit
3d250bfa49
|
@ -448,13 +448,16 @@ if (isset($_GET['query'])) {
|
||||||
break;
|
break;
|
||||||
case "fido2-get-args":
|
case "fido2-get-args":
|
||||||
header('Content-Type: application/json');
|
header('Content-Type: application/json');
|
||||||
// Login without username, no ids!
|
// fetch allowed credentialIds
|
||||||
// $ids = fido2(array("action" => "get_all_cids"));
|
$cids = fido2(array("action" => "get_all_cids"));
|
||||||
// if (count($ids) == 0) {
|
if (count($cids) == 0) {
|
||||||
// return;
|
print(json_encode(array(
|
||||||
// }
|
'type' => 'error',
|
||||||
$ids = NULL;
|
'msg' => 'Cannot find matching credentialIds'
|
||||||
$getArgs = $WebAuthn->getGetArgs($ids, 30, true, true, true, true, $GLOBALS['FIDO2_UV_FLAG_LOGIN']);
|
)));
|
||||||
|
}
|
||||||
|
|
||||||
|
$getArgs = $WebAuthn->getGetArgs($cids, 30, true, true, true, true, $GLOBALS['FIDO2_UV_FLAG_LOGIN']);
|
||||||
print(json_encode($getArgs));
|
print(json_encode($getArgs));
|
||||||
$_SESSION['challenge'] = $WebAuthn->getChallenge();
|
$_SESSION['challenge'] = $WebAuthn->getChallenge();
|
||||||
return;
|
return;
|
||||||
|
@ -486,6 +489,12 @@ if (isset($_GET['query'])) {
|
||||||
while($row = array_shift($rows)) {
|
while($row = array_shift($rows)) {
|
||||||
$cids[] = base64_decode($row['keyHandle']);
|
$cids[] = base64_decode($row['keyHandle']);
|
||||||
}
|
}
|
||||||
|
if (count($cids) == 0) {
|
||||||
|
print(json_encode(array(
|
||||||
|
'type' => 'error',
|
||||||
|
'msg' => 'Cannot find matching credentialIds'
|
||||||
|
)));
|
||||||
|
}
|
||||||
|
|
||||||
$getArgs = $WebAuthn->getGetArgs($cids, 30, true, true, true, true, $GLOBALS['WEBAUTHN_UV_FLAG_LOGIN']);
|
$getArgs = $WebAuthn->getGetArgs($cids, 30, true, true, true, true, $GLOBALS['WEBAUTHN_UV_FLAG_LOGIN']);
|
||||||
$getArgs->publicKey->extensions = array('appid' => "https://".$getArgs->publicKey->rpId);
|
$getArgs->publicKey->extensions = array('appid' => "https://".$getArgs->publicKey->rpId);
|
||||||
|
|
Loading…
Reference in New Issue