Skip to content

Passkeys: login #14

Description

@ParallelEntrepreneur

Part of #1.

Blocked by: #13 (Passkeys: registration)

Problem. Passkey login must work both with a known user (email first) and discoverable credentials (no email, the authenticator picks), and must update the signature counter to detect cloned authenticators.

Proposed approach.

  • POST /passkeys/login/options with an optional email: returns PublicKeyCredentialRequestOptions with a fresh challenge row; when an email is given, allowCredentials lists that user's passkeys; when not, it is empty and the authenticator offers discoverable credentials.
  • POST /passkeys/login/verify: consumes the challenge, looks up the credential by id, verifies the assertion signature over authenticatorData || sha256(clientDataJSON) with the stored COSE key, checks userPresent, checks the sign count is greater than stored when both are non-zero (a regression marks the credential suspect and refuses), stores the new count, and issues a session.
  • Conditional UI (autofill) support: the options endpoint tolerates an empty request so the browser can pre-fetch.

Acceptance criteria

  • Assertion verification tested with fixtures for P-256, RSA and Ed25519 keys
  • Sign-count regression detected and refused; tested
  • Unknown credential id and consumed challenge both fail without revealing which
  • Manual run in a real browser including the discoverable-credential path

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    authshared authentication servicesecuritytouches credentials or token issuing

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions