Yubico / php-u2flib-server

(OBSOLETE) U2F library in PHP
https://developers.yubico.com/php-u2flib-server/
BSD 2-Clause "Simplified" License
289 stars 68 forks source link

Problems with Challenge #46

Closed ChrisWesterfield closed 8 years ago

ChrisWesterfield commented 8 years ago

Hi, I included this Library into my Symfony Project. I used the Bundle: https://github.com/darookee/u2f-two-factor-bundle to work with it. But it will not work. Everytime I try to validate my Yubikey Neo 4 device I get the following message:

Error in U2F.php line 266: No matching request found

This is the Part where it seems to break (within the U2F Library)

foreach ($requests as $req) {
      if( !is_object( $req ) ) {
        throw new \InvalidArgumentException('$requests of doAuthenticate() method only accepts array of object.');
  }
  if($req->keyHandle === $response->keyHandle && $req->challenge === $decodedClient->challenge) {
        break;
  }
  $req = null;
}
if($req === null) {
  throw new Error('No matching request found', ERR_NO_MATCHING_REQUEST );
}

What I could find out is, that the Challenge that the Library returns does not match the Challange that the Yubikey Returns. I can't figure out what the Problem is. As all Parts (the Bundle) just forward theire calls to the php-u2flib-server library. Nothing more. Please help.

klali commented 8 years ago

First off, this works fine with a YubiKey 4 as well. Can you use current git HEAD of this library (if nothing else so the lines match and you get any potential fixes)? If you run the examples included in this library, does it work?

ChrisWesterfield commented 8 years ago

I will try this and update the ticket