Skip to content

Passing opaque user data up from CredentialRepository? #274

@iaik-jheher

Description

@iaik-jheher

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions