Skip to content

Email and password: login #20

Description

@ParallelEntrepreneur

Part of #1.

Blocked by: #19 (Email and password: registration with argon2)

Problem. Login must verify in constant time against an existing hash, resist enumeration, and honour the lockout.

Proposed approach. POST /password/login { email, password }: rate limits and captcha first; look up the password credential; when absent, verify against a fixed dummy hash so timing does not differ; on success issue a session and, if the stored hash's parameters are older than the current ones, rehash and update. Failures increment the lockout counter; the response body is identical for wrong password, unknown email and locked account, with the lockout distinguishable only by Retry-After once the limit is hit.

Acceptance criteria

  • Correct password issues a session; wrong password, unknown email and disabled account produce identical bodies
  • Dummy-hash path exercised in a test
  • Rehash-on-login tested with an old parameter set
  • Lockout interaction tested with the rate-limiting issue's fakes

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