java-webauthn-server icon indicating copy to clipboard operation
java-webauthn-server copied to clipboard

Asynchronous credential repository support

Open jroper opened this issue 2 years ago • 1 comments

The current credential repository interface requires that all the invoked methods are handled synchronously. This doesn't work if you're using an asynchronous database driver in an asynchronous web framework, such as on Play Framework, Akka HTTP, etc. It would be ideal if the java-webauthn-server core library could provide asynchronous alternatives, allowing database lookups to return CompletionStage etc.

jroper avatar Aug 17 '22 02:08 jroper

Hi! This is a good idea, but it'll likely take some pretty significant refactoring to support. I'd been thinking the stateless design of the library would hopefully play nice with asynchronous architectures, but you're right that the nature of the "callbacks" in CredentialRepository throw a wrench in that.

I think async support shouldn't be too hard to implement, the main question is whether it can be done without breaking backwards compatibility. I can't give you a time frame just yet, but I'll try to look into the feasibility of it soon.

emlun avatar Aug 22 '22 12:08 emlun