Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Choose platform #23

Merged
merged 2 commits into from
Nov 14, 2019
Merged

Choose platform #23

merged 2 commits into from
Nov 14, 2019

Conversation

rayauxey
Copy link
Contributor

Hey I'm Raymond from Kenya. I luckily got to see your blog post on how you were able to come up with a back-end implementation of WebAuthn for NodeJs. Thanks for embracing open source by sharing your efforts with other developers.

I've added the option for specifying the authenticator from the back-end since my use-case involves using WebAuthn for smartphones with bio-metric recognition features such as a 'Fingerprint Sensor'. I've given the parameter a default value ('cross-platform') to prevent breaking changes. I've also added a validator to make sure values passed for authenticator and attestation are valid, if not, they are set to their corresponding defaults.

Example Usage:

// api.js

app.post('/request-register', (req, res) => {
    const { id, email } = req.body;

    const challengeResponse = generateRegistrationChallenge({
        relyingParty: { name: 'ACME' },
        user: { id, name: email },
        authenticator: 'platform' // Here is where you choose the authenticator
    });

    userRepository.create({
        id,
        email,
        challenge: challengeResponse.challenge,
    })

    res.send(challengeResponse);
});

Yours Sincerely,
Raymond Nyaga (rayauxey@gmail.com)

Copy link

@djhi djhi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@Kmaschta Kmaschta added this to the 0.1.4 milestone Nov 14, 2019
@Kmaschta Kmaschta merged commit dea0a7c into wallix:master Nov 14, 2019
@Kmaschta
Copy link
Contributor

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants