mihaita-tinta / webauthn-spring-boot-starter

Simple spring boot starter based on Yubico/java-webauthn-server
19 stars 11 forks source link

Consider splitting into two starters for web API and storage #26

Closed rhys-saldanha closed 2 years ago

rhys-saldanha commented 2 years ago

Whilst I really like this starter, and want to use it in my projects, I already have an existing database table for storing users.

Would you consider splitting this starter into a webauthn-spring-boot-starter-web and webauthn-spring-boot-starter-jpa, where the latter is optional and a developer can choose to instead provide spring beans of some interface or interfaces for user storage and retrieval?

mihaita-tinta commented 2 years ago

Hi. Thanks for your proposal. It can simplify things a lot. With this initial approach you would have to link users between your tables and what the library stores.

Can you try to add your own WebAuthnUserRepository and WebAuthnCredentialsRepository (primary) beans? There are however quite a few methods you need to implement.

mihaita-tinta commented 2 years ago

I added the library on this branch. The jpa starter is here and two working examples webauthn starter + jpa and webauthn starter + in memory. I will test this a little more and once I'm done I will update everything to 0.2.0-RELEASE. If you have any feedback on the changes just let me know.

mihaita-tinta commented 2 years ago

You can also add other user/credentials repos. The library has a conditional hint and if you define one you should be able to use it.

mihaita-tinta commented 2 years ago

@rhys-saldanha I will close the issue. If you have any questions/feebdack about this update you can reopen the issue. Thanks.