Bug? Spring Security WebAuthn authentication saves anonymousUser
in PublicKeyCredentialUserEntityRepository
#16385
Labels
anonymousUser
in PublicKeyCredentialUserEntityRepository
#16385
Asked in Stack Overflow a week ago.
https://stackoverflow.com/questions/79322876/why-does-spring-security-webauthn-authentication-save-anonymoususer-in-publick
Minimum Viable Example with Steps to Reproduce
I included a Minimum Reproducible Example with Steps in the Stack Overflow post.
App in GitHub: https://github.com/justincranford/spring-security-webauthn-demo
Spring versions used:
Expected behavior
Expected behavior is
anonymousUser
should not be persisted in PublicKeyCredentialUserEntityRepository.java.Said another way, expectation is WebAuthn functionality should only ever persist UserEntity and Credential, for authenticated users.
However, I see
anonymousUser
is persisted during WebAuthn Authentication. That seems like a bug.Or, if there is a valid reason for persisting
anonymousUser
, I would like to understand the design intent, so I can handle it securely and correctly.Logs
Logs from my wrapper of MapPublicKeyCredentialUserEntityRepository.java, to highlight what I see during WebAuthn Register and WebAuthn Authenticate.
WebAuthn Register
Notice user
u
was not found, then saved, then it was looked up again and found.Assumes user logged in at https://localhost:8443/ of my sample app with username=u and password=p, before attempting WebAuthn Register.
WebAuthn Authenticate
Notice user
anonymousUser
was not found, then saved, and then useru
was looked up and found. Useru
is the correct user saved during WebAuthn Register. It think the saving ofanonymousUser
is likely a bug.Assumes user logged out before attempting WebAuthn Authenticate at https://localhost:8443/ of my sample app.
The text was updated successfully, but these errors were encountered: