MasterKale / SimpleWebAuthn

WebAuthn, Simplified. A collection of TypeScript-first libraries for simpler WebAuthn integration. Supports modern browsers, Node, Deno, and more.
https://simplewebauthn.dev
MIT License
1.63k stars 137 forks source link

Windows server2019 problem #319

Closed iLonaKarpova closed 1 year ago

iLonaKarpova commented 1 year ago

I've wrote some simple project using SimpleWebAuthn that does registration and auth. It works great on localhost (running Windows 11), but fails when deployed at server env (running Windows Server 2019) with an error: react_devtools_backend.js:4012 Error: Invalid key for curve: "Public key is not a point" at t.exports (async-vendor.js:91:329050) at t.exports (async-vendor.js:91:327623) at e.convertPublicKeyToPEM (async-vendor.js:91:326888) at e.verifySignature (async-vendor.js:73:28917) at e.verifyAuthenticationResponse (async-v Could you please share any ideas what could be the reason?

MasterKale commented 1 year ago

Can you share more about how you're calling @simplewebauthn/server's methods? Code samples, ideally.

async-vendor.js

Are you bundling @simplewebauthn/server into a front end project? It's not often you see vendoring like this in Node projects. If you are then that's part of the problem, Node is the only supported runtime for @simplewebauthn/server right now.

iLonaKarpova commented 1 year ago

Hello, Matthew. Thank you for your response, you are right, I'm bundling server into a front end project as a part of a demo project. I'll change it then. Thank you very much. Best regards, iLona Karpova

On Wed, Dec 28, 2022, 08:48 Matthew Miller @.***> wrote:

Can you share more about how you're calling @simplewebauthn/server's methods? Code samples, ideally.

async-vendor.js

Are you bundling @.**/server into a front end project? It's not often you see vendoring like this in Node projects. If you are then that's part of the problem, Node is the only supported runtime for @simplewebauthn/server right now.

— Reply to this email directly, view it on GitHub https://github.com/MasterKale/SimpleWebAuthn/issues/319#issuecomment-1366386512, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZ5BO4F6PW5CGCYNMTEVD5LWPPID5ANCNFSM6AAAAAATJWUCZA . You are receiving this because you authored the thread.Message ID: @.***>

MasterKale commented 1 year ago

If you're the adventurous type, the master branch currently has #299 in it which did a huge refactor to try and make it possible for server to run on more platforms. This includes using WebCrypto and Uint8Array everywhere, which means it's feasible to include server in a front end project as there's no longer going to be anything tightly coupling server to Node.

The catch is that you'd have to figure out how to get your project to work with CommonJS modules. I wouldn't spend a whole lot of time on that if you did decide to experiment with what will be released as SimpleWebAuthn v7.0.0 early next year, though, as in my experiments getting server running in a vite project I had to abandon CommonJS completely to get server running in the browser.

After v7.0.0 debuts I plan on taking another look at how I might make it possible for server to run in more browser-like environments, including browsers for those interested in building fully-contained demo sites. If you're interested I can tag you in a follow-up issue or discussion in the future when I have something for you to properly test with.

iLonaKarpova commented 1 year ago

Hello, Matthew. Great plans! I'm very interested in your project cause it looks like future of authentication, so please tag me. Also I talked to our system administrator, he is certain that the project is working locally because I'm logged as windows administrator and don't have special permissions set up. I'm not sure why it influences key generation procedure, what can be forbidden there. Perhaps I'll investigate in that direction while you are preparing new release. Happy New Year and thank you again for your work and help! Have a good weekend, iLona Karpova

On Wed, Dec 28, 2022, 18:12 Matthew Miller @.***> wrote:

If you're the adventurous type, the master branch currently has #299 https://github.com/MasterKale/SimpleWebAuthn/pull/299 in it which did a huge refactor to try and make it possible for server to run on more platforms. This includes using WebCrypto and Uint8Array everywhere, which means it's feasible to include server in a front end project as there's no longer going to be anything tightly coupling server to Node.

The catch is that you'd have to figure out how to get your project to work with CommonJS modules. I wouldn't spend a whole lot of time on that if you did decide to experiment with what will be released as SimpleWebAuthn v7.0.0 early next year, though, as in my experiments getting server running in a vite project I had to abandon CommonJS completely to get server running in the browser.

After v7.0.0 debuts I plan on taking another look at how I might make it possible for server to run in more browser-like environments, including browsers for those interested in building fully-contained demo sites. If you're interested I can tag you in a follow-up issue or discussion in the future when I have something for you to properly test with.

— Reply to this email directly, view it on GitHub https://github.com/MasterKale/SimpleWebAuthn/issues/319#issuecomment-1366721811, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZ5BO4EYNBAUENWDIIQPCOLWPRKHRANCNFSM6AAAAAATJWUCZA . You are receiving this because you authored the thread.Message ID: @.***>