Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The operation either timed out or was not allowed. #93

Open
Whip opened this issue May 28, 2024 · 4 comments
Open

The operation either timed out or was not allowed. #93

Whip opened this issue May 28, 2024 · 4 comments
Labels
help wanted Extra attention is needed

Comments

@Whip
Copy link

Whip commented May 28, 2024

For some reason, I'm getting this error on login from navigator.credentials.create. This happen sometimes and for some accounts but not for others. Can you tell what is the reason/source of this error? Here's the code

try {
	$WebAuthn = new lbuchs\WebAuthn\WebAuthn('Project Name', 'ProjectDomain', ['none']);
	$createArgs = $WebAuthn->getCreateArgs($customer['id'], $email, $customer['name'], 120, 'required', 'required', null);
	$challenge = $WebAuthn->getChallenge();
  $_SESSION['login-challenge'] = [
  	'challenge' => $challenge->getBinaryString(),
  	'userId' => $customer['id'],
  	'email' => $email
	];

  echo json_encode([
  	'actionRequired' => 'newDevice',
  	'createArgs' => $createArgs
  ]);
} catch (Exception $e) {
	echo '{"error":"'.$e->getMessage().'"}';
}

This response from php is provided to js

if(pubKeyCredOpts.actionRequired == 'newDevice'){
	recursiveBase64StrToArrayBuffer(pubKeyCredOpts.createArgs);

	navigator.credentials.create(pubKeyCredOpts.createArgs).then(cred => {
		const publicKeyCredential = {
			transports: cred.response.getTransports ? cred.response.getTransports() : null,
			clientDataJSON: cred.response.clientDataJSON ? arrayBufferToBase64(cred.response.clientDataJSON) : null,
			attestationObject: cred.response.attestationObject ? arrayBufferToBase64(cred.response.attestationObject) : null
		};

		// step 4 request
		verifyCreds('NewDevice', publicKeyCredential);

	}).catch(err => {
		handleError(err); <- This is executed showing the error
	});
}
@lbuchs lbuchs added the help wanted Extra attention is needed label Jul 4, 2024
@lbuchs
Copy link
Owner

lbuchs commented Jul 4, 2024

a not allowed error could mean that the user has no device to register passkeys.

@lbuchs lbuchs closed this as completed Jul 4, 2024
@lbuchs lbuchs reopened this Jul 4, 2024
@Whip
Copy link
Author

Whip commented Jul 4, 2024

Does this mean that the biometric hardware on the device is unavailable for some reason?

@lbuchs
Copy link
Owner

lbuchs commented Jul 4, 2024

I think on Windows it can happen when Windows Hello has not been set up and you don't have any other device (USB key, NFC, Bluetooth etc.)

@Whip
Copy link
Author

Whip commented Jul 4, 2024

I've mostly seen it on android though. When I started field testing it, on some phones folks had the fingerprint setup to unlock the phone but when registering on my website, they get this error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants