Yubico / java-webauthn-server

Server-side Web Authentication library for Java https://www.w3.org/TR/webauthn/#rp-operations
Other
457 stars 142 forks source link

Not able to store object for PublicKeyCredentialCreationOptions in redis for caching purpose. #242

Closed dhirajsable closed 1 year ago

dhirajsable commented 1 year ago

I have spring boot app with reds as a session storage and Whenever I tried to store PublicKeyCredentialCreationOptions in Redis cache then its giving issues as Object non-serializable. Is there any solution for this ?

Its working fine if I use in memory cache in app.

emlun commented 1 year ago

Hi! You can use the [toJson()](https://developers.yubico.com/java-webauthn-server/JavaDoc/webauthn-server-core/2.1.0/com/yubico/webauthn/data/PublicKeyCredentialCreationOptions.html#toJson()) and fromJson() methods to serialize and deserialize the objects for storage. AssertionRequest has similar methods as well. We've chosen not to implement Serializable since there are a lot of issues with it.

dhirajsable commented 1 year ago

Thanks for response. Let me try it out

emlun commented 1 year ago

I hope that helped, I'll close this for now. You're welcome to re-open the issue if you're still encountering problems.