Update login.php
This commit is contained in:
@@ -21,6 +21,82 @@ try {
|
|||||||
$post = json_decode($post, null, 512, JSON_THROW_ON_ERROR);
|
$post = json_decode($post, null, 512, JSON_THROW_ON_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($fn !== 'getStoredDataHtml') {
|
||||||
|
|
||||||
|
// Formats
|
||||||
|
$formats = [];
|
||||||
|
//if (filter_input(INPUT_GET, 'fmt_android-key')) {
|
||||||
|
$formats[] = 'android-key';
|
||||||
|
//}
|
||||||
|
///if (filter_input(INPUT_GET, 'fmt_android-safetynet')) {
|
||||||
|
$formats[] = 'android-safetynet';
|
||||||
|
//}
|
||||||
|
//if (filter_input(INPUT_GET, 'fmt_apple')) {
|
||||||
|
$formats[] = 'apple';
|
||||||
|
//}
|
||||||
|
//if (filter_input(INPUT_GET, 'fmt_fido-u2f')) {
|
||||||
|
$formats[] = 'fido-u2f';
|
||||||
|
//}
|
||||||
|
//if (filter_input(INPUT_GET, 'fmt_none')) {
|
||||||
|
$formats[] = 'none';
|
||||||
|
//}
|
||||||
|
//if (filter_input(INPUT_GET, 'fmt_packed')) {
|
||||||
|
$formats[] = 'packed';
|
||||||
|
//}
|
||||||
|
//if (filter_input(INPUT_GET, 'fmt_tpm')) {
|
||||||
|
$formats[] = 'tpm';
|
||||||
|
//}
|
||||||
|
|
||||||
|
$rpId=$_SERVER['SERVER_NAME'];
|
||||||
|
|
||||||
|
$typeUsb = true;
|
||||||
|
$typeNfc = true;
|
||||||
|
$typeBle = true;
|
||||||
|
$typeInt = true;
|
||||||
|
$typeHyb = true;
|
||||||
|
|
||||||
|
// cross-platform: true, if type internal is not allowed
|
||||||
|
// false, if only internal is allowed
|
||||||
|
// null, if internal and cross-platform is allowed
|
||||||
|
$crossPlatformAttachment = null;
|
||||||
|
if (($typeUsb || $typeNfc || $typeBle || $typeHyb) && !$typeInt) {
|
||||||
|
$crossPlatformAttachment = true;
|
||||||
|
|
||||||
|
} else if (!$typeUsb && !$typeNfc && !$typeBle && !$typeHyb && $typeInt) {
|
||||||
|
$crossPlatformAttachment = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// new Instance of the server library.
|
||||||
|
// make sure that $rpId is the domain name.
|
||||||
|
$WebAuthn = new lbuchs\WebAuthn\WebAuthn('WebAuthn Library', $rpId, $formats);
|
||||||
|
|
||||||
|
// add root certificates to validate new registrations
|
||||||
|
//if (filter_input(INPUT_GET, 'solo')) {
|
||||||
|
$WebAuthn->addRootCertificates('rootCertificates/solo.pem');
|
||||||
|
//}
|
||||||
|
//if (filter_input(INPUT_GET, 'apple')) {
|
||||||
|
$WebAuthn->addRootCertificates('rootCertificates/apple.pem');
|
||||||
|
//}
|
||||||
|
//if (filter_input(INPUT_GET, 'yubico')) {
|
||||||
|
$WebAuthn->addRootCertificates('rootCertificates/yubico.pem');
|
||||||
|
//}
|
||||||
|
//if (filter_input(INPUT_GET, 'hypersecu')) {
|
||||||
|
$WebAuthn->addRootCertificates('rootCertificates/hypersecu.pem');
|
||||||
|
//}
|
||||||
|
//if (filter_input(INPUT_GET, 'google')) {
|
||||||
|
$WebAuthn->addRootCertificates('rootCertificates/globalSign.pem');
|
||||||
|
$WebAuthn->addRootCertificates('rootCertificates/googleHardware.pem');
|
||||||
|
//}
|
||||||
|
//if (filter_input(INPUT_GET, 'microsoft')) {
|
||||||
|
$WebAuthn->addRootCertificates('rootCertificates/microsoftTpmCollection.pem');
|
||||||
|
//}
|
||||||
|
//if (filter_input(INPUT_GET, 'mds')) {
|
||||||
|
$WebAuthn->addRootCertificates('rootCertificates/mds');
|
||||||
|
//}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// ------------------------------------
|
// ------------------------------------
|
||||||
// request for create arguments
|
// request for create arguments
|
||||||
// ------------------------------------
|
// ------------------------------------
|
||||||
@@ -107,7 +183,7 @@ try {
|
|||||||
$WebAuthn->processGet($clientDataJSON, $authenticatorData, $signature, $credentialPublicKey, $challenge, null, $userVerification === 'required');
|
$WebAuthn->processGet($clientDataJSON, $authenticatorData, $signature, $credentialPublicKey, $challenge, null, $userVerification === 'required');
|
||||||
|
|
||||||
//we have authenticated the user!
|
//we have authenticated the user!
|
||||||
//we need to get the values form db at this point!
|
|
||||||
|
|
||||||
$return = new stdClass();
|
$return = new stdClass();
|
||||||
$return->success = true;
|
$return->success = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user