Giter Club home page Giter Club logo

Comments (3)

MasterKale avatar MasterKale commented on May 25, 2024

Check out decodeAttestationObject() and parseAuthenticatorData() exported from @simplewebauthn/server/helpers. Do either of those help you achieve your goals? There are many other helpers exported from there that you might find interesting too:

export {
convertAAGUIDToString,
convertCertBufferToPEM,
convertCOSEtoPKCS,
cose,
decodeAttestationObject,
decodeClientDataJSON,
decodeCredentialPublicKey,
generateChallenge,
generateUserID,
getCertificateInfo,
isCertRevoked,
isoBase64URL,
isoCBOR,
isoCrypto,
isoUint8Array,
parseAuthenticatorData,
toHash,
validateCertificatePath,
verifySignature,
};

from simplewebauthn.

wparad avatar wparad commented on May 25, 2024

Hmmm, I didn't realize it was a separate export in the package.json. Maybe there is a better way to do this, but this seems a bit annoying:

parseAuthenticatorData(
    decodeAttestationObject(
        new Uint8Array(base64url.toBuffer(attestation))
    ).get('authData'));

And I will also add that depending on the usage, callers of the library might need to explicitly exclude lint issues with:

"node/no-missing-require": ["error", {
      "allowModules": ["@simplewebauthn/server"]
    }]

Link to issue with require statements in eslint

I would have expected a single method that takes in the attestation in the same format as verifyRegistrationResponse which is base64url and returns the same object that is the response RegistrationData without needing to stack these methods or know to convert to a Uint8Array.

But I guess this is technically already supported, so we can close it.

from simplewebauthn.

MasterKale avatar MasterKale commented on May 25, 2024

Thanks for the feedback @wparad. These helpers are used internally by the various option-generation and response-verification methods that represent the core methods of the @simplewebauthn/server package. I make them available via the helpers import for those who are intrepid enough to break out of the core WebAuthn use cases, so a bit of extra work should always be expected when using them.

from simplewebauthn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.