php-yubico icon indicating copy to clipboard operation
php-yubico copied to clipboard

NO_VALID_ANSWER

Open tylermenezes opened this issue 9 years ago • 3 comments

This library doesn't seem to work for me -- it always returns "NO_VALID_ANSWER" no matter what.

In fact, it's not just me -- your own demo page doesn't work: https://demo.yubico.com/php-yubico/demo.php

tylermenezes avatar Apr 20 '15 21:04 tylermenezes

It is currently working. Try changing the OTP to a real Yubikey OTP string.

NO_VALID_ANSWER seems to be the response when it is not a password replay nor a valid OTP.

NiklasBr avatar Apr 22 '15 14:04 NiklasBr

I too am having issues with no valid answer. I have an API key (clientId, secretKey) and am taking otp as an input variable, but it doesn't seem to be working. I assumed that the ID and secret was added in place of the 24 and FOOBAR, as shown below.

require_once 'assets/scripts/Auth_Yubico-2.6/Yubico.php'; if(isset($_GET["otp"])) { $clientId = "24"; $secretKey = "FOOBAR="; $otp = $_GET['otp']; $yubi = new Auth_Yubico(clientId, secretKey); $auth = $yubi->verify($otp);

    if (PEAR::isError($auth)) {
            print "<p>Authentication failed: " . $auth->getMessage();
            print "<p>Debug output from server: " . $yubi->getLastResponse();
    } else {
            print "<p>You are authenticated!";
    }

}

Authentication failed: NO_VALID_ANSWER

Debug output from server:

charlesshoults avatar Jan 03 '20 18:01 charlesshoults

I figured out my issue. On the line where I'm referring to the previously set clientId and secretKey, I need to have a $ for the variable.

charlesshoults avatar Jan 03 '20 20:01 charlesshoults