tweag / webauthn

A library for parsing and validating webauthn/fido2 credentials
Apache License 2.0
34 stars 11 forks source link

Improve server authentication flow #38

Closed infinisil closed 2 years ago

infinisil commented 2 years ago

As mentioned in #34, the demo server currently has some problems which make it unsuitable to copy from for an actual website server:

We can fix this by:

lykahb commented 2 years ago

I see the demo server more as extended documentation, rather than a template for production. Fixing the session issues would make it larger and less focused on illustrating proper usage of haskell-fido2.

What do you think of adding a readme.md for the demo server with a list of caveats instead?

infinisil commented 2 years ago

@lykahb I think it would be valuable to have this because:

infinisil commented 2 years ago

I guess regarding complexity, both the current way and the proposed way have some, but it took me a lot of time to understand the current code, and I believe it would be a lot easier to understand with the proposed way.

lykahb commented 2 years ago

@Infinisil I completely agree that the current code in the demo is complex and takes a lot of time to understand. I see the current state as an awkward one between a minimal server that only illustrates the usage of the library (ignoring the rest of user management), and a ready-to-use template. It has too many other things going on to be the former, and is not solid enough to be the latter.

In my last comment I had the former case in mind. But evolving it in either direction would be an improvement. If this change simplifies it too, that'd be great!

infinisil commented 2 years ago

I just took a good look at the whole problem of session storage, here's some notes:

infinisil commented 2 years ago

Work is in progress for this to be fixed in #42

infinisil commented 2 years ago

Done with above PR