javascriptgoogle-chromegoogle-app-enginefido-u2fyubico

Fido U2F client side javascript source code


I'm looking for a JavaScript source code (client side) to make communication between Fido U2F token and Google Chrome (Version 41.0.2272.89 m).

Please help me


Solution

  • Here is an example to getting the Token response for registration using Yubico u2f-api file

    var RegistrationData = {"challenge":"dG7vN-E440ZnJaKQ7Ynq8AemLHziJfKrBpIBi5OET_0",
                         "appId":"https://localhost:8443",
                         "version":"U2F_V2"};
    
    window.u2f.register([RegistrationData], [],
      function(data) {if(data.errorCode) {
            alert("U2F failed with error: " + data.errorCode);
            return;
        }
        alert(JSON.stringify(data));
    }); 
    

    you've to include the u2f-api.js and use an Https server