Not necessarily an issue, but the JavaDoc isn't entirely clear on this. (Or, if it is, I couldn't find it - apologies if so.)
I am trying to integrate passwordless authentication using client-side discoverable credentials into existing infrastructure, which imposes some limitations.
We intend to store (credential, user identifier) pairs, indexed by credentialId. We identify users internally using an identifier that is personal data, and which we thus cannot store directly in the user handle. As I understand it, the user handle's primary purpose is deduplication of resident credentials; therefore, we intended to specify a keyed hash digest (using a server private key) as the user handle. This is of course not reversible, but since we index all known credentials by their ID, this is not an issue for us.
I am now trying to map this behavior onto the CredentialRepository interface.
getCredentialIdsForUsername: is returning an empty set permissible when using client-side discoverable credentials (e.g., this is only used to populate allowCredentials) or would this cause validation to fail?
getUserHandleForUsername: is this used/required when using client-side discoverable credentials?
getUsernameForUserHandle: is this used when validating the received credential, or can I safely return Optional.empty?
lookup: I assume this is used when validating a credential; I would retrieve the credential by ID, re-calculate the user handle, and return Optional.empty on failure; does this match what the library expects?
Not necessarily an issue, but the JavaDoc isn't entirely clear on this. (Or, if it is, I couldn't find it - apologies if so.)
I am trying to integrate passwordless authentication using client-side discoverable credentials into existing infrastructure, which imposes some limitations.
We intend to store
(credential, user identifier)pairs, indexed bycredentialId. We identify users internally using an identifier that is personal data, and which we thus cannot store directly in the user handle. As I understand it, the user handle's primary purpose is deduplication of resident credentials; therefore, we intended to specify a keyed hash digest (using a server private key) as the user handle. This is of course not reversible, but since we index all known credentials by their ID, this is not an issue for us.I am now trying to map this behavior onto the
CredentialRepositoryinterface.getCredentialIdsForUsername: is returning an empty set permissible when using client-side discoverable credentials (e.g., this is only used to populateallowCredentials) or would this cause validation to fail?getUserHandleForUsername: is this used/required when using client-side discoverable credentials?getUsernameForUserHandle: is this used when validating the received credential, or can I safely returnOptional.empty?lookup: I assume this is used when validating a credential; I would retrieve the credential by ID, re-calculate the user handle, and returnOptional.emptyon failure; does this match what the library expects?