jaredhanson / passport-webauthn Goto Github PK
View Code? Open in Web Editor NEWWebAuthn authentication strategy for Passport.
License: MIT License
WebAuthn authentication strategy for Passport.
License: MIT License
work perfectly on localhost when deploy app on server it generates error
"Forbidden 403" ("AuthenticationError")
Hello,
Would appreciate it if types can be defined for this library as it would be helpful for Node projects written in TypeScript.
First of all, many thanks for this amazing library. I tried the example todos app and it worked like charm.
I am trying to use client side library instead of using the EJS
. They will have two different urls.
When trying to do signup, I get the challenge but register
is never triggered as a result of which I am not able to store the public key.
I always get 403 forbidden because of this reason. Do you think I am doing something wrong here ?
Hi there - this project uses base64url
on server-side and on client-side the demo uses base64-arraybuffer
(albeit an outdated version). A new version of base64-arraybuffer
is at https://github.com/niklasvh/base64-arraybuffer.
We recommend a few things:
base64url
, use base64-arraybuffer
from npm insteadtoBuffer
method in existing instances, simply use decode
First of all, thanks a lot for this plugin. It's awesome to be able to easily bring this security layer into our apps so "easily".
That being said, I'm facing a problem and I think this plugin is not following the specs to the letter: my application has two different subdomains, app.xyz.com
for the client and api.xyz.com
for the backend. The webauthn specs (https://www.w3.org/TR/webauthn-2/) said that this scenario can work as long as we define an 'RP ID' on the client interaction with the browser to retrieve the challenge and key.
From the docs:
but this library is performing an strict equality check between origin and host (or proxied host):
https://github.com/jaredhanson/passport-webauthn/blob/master/lib/strategy.js#L63-L65
and also the RP ID hashes won't match as defined in the code:
https://github.com/jaredhanson/passport-webauthn/blob/master/lib/strategy.js#L106-L108
and here:
https://github.com/jaredhanson/passport-webauthn/blob/master/lib/strategy.js#L181-L183
I will try to raise an MR with the fixes ASAP.
But please, let me know if my assumptions are correct, this is really new to me and was just reading about it because I could not make it work in my production environment.
Hi @jaredhanson,
Do you have plans to continue this project? Are you open to contributions?
Best,
José
working perfect on localhost but when host on some domain eg(account.abc.com) says Orgin Missmatch , I Resolved This Error Tempory Based
replace node_modules/passport-fido2-webauthn/lib/utils.js
exports.originalOrigin = function(req, options) {
options = options || {};
var app = req.app;
if (app && app.get && app.get('trust proxy')) {
options.proxy = true;
}
var trustProxy = options.proxy;
var proto = (req.headers['x-forwarded-proto'] || '').toLowerCase()
, tls = req.connection.encrypted || (trustProxy && 'https' == proto.split(/\s*,\s*/)[0])
, host = (trustProxy && req.headers['x-forwarded-host']) || req.headers.host
, protocol = tls ? 'https' : 'http';
return protocol + '://' + host;
};
TO
exports.originalOrigin = function(req, options) {
const origin = req.get('origin');
return origin;
};
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.