-
Notifications
You must be signed in to change notification settings - Fork 6.1k
WebAuthn + Redis doesn't work; Redis defaults to JdkSerializationRedisSerializer, WebAuthn classes lack Serializable interface, WebAuthn mixins missing for GenericJackson2JsonRedisSerializer #16328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
TL;DR Here are the interesting bits for creating an ObjectMapper that allowed me to serialize/deserialize WebAuthn
|
TL;DR Here are the interesting bits for my The below config allowed me to initialize Redis to use GenericJackson2JsonRedisSerializer (JSON) instead of the non-working, default JdkSerializationRedisSerializer. My
|
@justincranford Thanks for the ticket. This support all makes sense. I've added for sub-issues that I think will take care of what you are looking for. If you'd like to contribute a PR please mention it on the sub issue. |
Hi @justincranford , I've tried to implement |
Sorry, I didn't have that issue. Just a guess, but only challenges go in Redis. Don't put passkeys in Redis. Double check if you are using different storage for 1+2 vs 3+4.
My demo repo https://github.com/justincranford/spring-security-webauthn-redis was a minimum viable example for Redis ser/des issues. Repos 1+2 are changed to Redis, but repos 3+4 are not changed. If this is your issue, add
You need JPA entities (and repos) for the registered passkeys and users. Map between your JPA entities and the Spring Security WebAuthn classes in your two service beans. Examples:
|
Hi @justincranford , Thanks very much for your explanation, I did what you said and added DB support instead of redis, created an article for that and mentioned your comment https://www.linkedin.com/pulse/passwordless-authentication-spring-security-passkeys-rodrigues-y1oye/?trackingId=wNImL90rQua2FrzXxRsiqQ%3D%3D |
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
WebAuthn persistence only works using in-memory SessionRepository?
Persistence doesn't seem to work out-of-the-box (OOTB) if using WebAuthn + Redis.
Serializable
interface required for JdkSerializationRedisSerializer to work.To Reproduce
I created a GitHub repo https://github.com/justincranford/spring-security-webauthn-redis to:
JdkSerializationRedisSerializer
issueGenericJackson2JsonRedisSerializer
, and the incremental workarounds I had to apply to make the WebAuthn service data classes serialize/deserialize OKRedisHttpSessionConfiguration redisHttpSessionConfiguration
bean to work, so I can override the default UUIDSessionGenerator. I could not figure out a workaround.Expected behavior
Sample
See GitHub repo README for a numbered list of the issues for Redis+WebAuthn JdkSerializationRedisSerializer, Redis+WebAuthn GenericJackson2JsonRedisSerializer, and RedisHttpSessionConfiguration override issue.
https://github.com/justincranford/spring-security-webauthn-redis
Timeline
I posted links to my GitHub repo and this Spring Security Issue WebAuthn + Redis doesn't work; Redis defaults to JdkSerializationRedisSerializer, WebAuthn classes lack Serializable interface, WebAuthn mixins missing for GenericJackson2JsonRedisSerializer #16328 on Dec 23, 2024.
I added two TL;DR comments, and appended this timeline, to the original description of this Spring Security Issue WebAuthn + Redis doesn't work; Redis defaults to JdkSerializationRedisSerializer, WebAuthn classes lack Serializable interface, WebAuthn mixins missing for GenericJackson2JsonRedisSerializer #16328 on Dec 26, 2024.
The text was updated successfully, but these errors were encountered: