fido-alliance / webauthn-demo

WebAuthn Workshop Demo [Completed DEMO is at completed demo-branch]
MIT License
733 stars 152 forks source link

Windows Hello? #16

Open MojoJojo opened 4 years ago

MojoJojo commented 4 years ago

Hi,

I was trying to modify the example for to work with Windows Hello but not sure how to go about it. I modified utils.js to allow for Windows Hello public keys:

pubKeyCredParams: [
            {
                type: "public-key", alg: -7 // "ES256" IANA COSE Algorithms registry
            },
            {
                //Windows Hello supports the RS256 algorithm
                type: "public-key",
                alg: -257
            },

        ],

However, when I run the demo, it fails with the following error on the server:

Error: Authenticator Data could not be parsed
    at parseAuthenticatorData (C:\xxxxx\webauthn-demo\utils.js:417:15)
    at Object.verifyAuthenticatorAttestationResponse (C:\xxxxx\webauthn-demo\utils.js:224:33)
    at C:\xxxxx\webauthn-demo\routes\webauthn.js:112:24
    at Layer.handle [as handle_request] (C:\xxxxx\webauthn-demo\node_modules\express\lib\router\layer.js:95:5)
    at next (C:\xxxxx\webauthn-demo\node_modules\express\lib\router\route.js:137:13)
    at Route.dispatch (C:\xxxxx\webauthn-demo\node_modules\express\lib\router\route.js:112:3)
    at Layer.handle [as handle_request] (C:\xxxxx\webauthn-demo\node_modules\express\lib\router\layer.js:95:5)
    at C:\xxxxx\webauthn-demo\node_modules\express\lib\router\index.js:281:22
    at Function.process_params (C:\xxxxx\webauthn-demo\node_modules\express\lib\router\index.js:335:12)
    at next (C:\xxxxx\webauthn-demo\node_modules\express\lib\router\index.js:275:10)

Seems like the parsing needs to be changed for Windows Hello format (or any other format for that matter)?

plehr commented 4 years ago

Try this: pubKeyCredParams: [ { type: "public-key", alg: -7 // "ES256" IANA COSE Algorithms registry }, { type: "public-key", alg: -257//Windows Hello supports the RS256 algorithm } ]

Kolobok12309 commented 2 years ago

Current demo don't support another, only fmt: fido-u2f, my windows hello use fmt: tpm https://github.com/fido-alliance/webauthn-demo/blob/ccea83d1b3d648c5be202e0ffd6823cb26df6876/utils.js#L266

Hexagon commented 2 years ago

A working and improved version (with Windows hello and android support) available at http://github.com/hexagon/webauthn-skeleton