-
Notifications
You must be signed in to change notification settings - Fork 159
Description
Sibling issue to #274, I suppose...
Is there a way to pass opaque data about the user to the CredentialRepository (in particular, the getCredentialIdsForUsername implementation) without that data being exposed to the user?
For context, we have an internal unique user identifier which is not human readable. We do not have unique human-readable usernames. We set .name() to a non-unique self-descriptor for the user. It is impossible for us to map this self-descriptor back to a unique user for purposes of getCredentialIdsForUsername.
From an implementation point of view, I suppose this is complicated by getCredentialIdsForUsername receiving the username (in particular, the same .name that is included in the PublicKeyCredentialCreationOptions that's sent to the client) instead of the full User object. Changing this would break backwards compatibility.
One backwards-compatible way of solving this would be to provide an @JsonIgnore Optional<String> internalUsername field (and associated builder method) on UserIdentity. In RelyingParty::startRegistration, you could then pass internalUsername to getCredentialIdsForUsername if it is set, and otherwise fall back to name.