Comments (3)
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:
SimpleWebAuthn/packages/server/src/helpers/index.ts
Lines 18 to 38 in b299b51
from simplewebauthn.
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.
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)
- Handle undefined `PublicKeyCredential` in `browserSupportsWebAuthnAutofill` helper HOT 1
- Discrepancy between example code and docs HOT 4
- get public key as string
- Make rpID required when generating authentication options HOT 1
- Clean up some docstrings in @simplewebauthn/server
- Rename `AuthenticatorDevice` type and usage
- Changed userHandle behavior v10 breaks definitely with existing registrations HOT 2
- RequireUserVerification Is Not Documented HOT 2
- Investigate impact of Deno moving its std library to JSR HOT 2
- Sign-in button capabilities like in Googles Demo HOT 1
- Upgraded to 10 from 9 and iphone no longer to connect with chrome HOT 10
- StartAutentication throwing 'Cannot read properties of undefined (reading 'replace') at base64URLStringToBuffer' HOT 2
- Error: No data when runnning verifyAuthenticationResponse HOT 7
- Add support for WebAuthn's conditional create HOT 7
- Wrong authenticatorAttachment after browser->startRegistration() with YubiKey HOT 1
- Error: No date at Object.decodePartialCBOR (C:\Users\siste\Desktop\web-authentication-main\node_modules\@levischuck\tiny-cbor\script\cbor\cbor.js:355:15) HOT 3
- Registering Passkey on MacOS - ICloud results in two passkeys being created HOT 1
- The check for browser auto fill doesn't take into account shadow DOMs (ie: web components) HOT 6
- A Node.js module is loaded ('crypto') which is not supported in the Edge Runtime. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simplewebauthn.