prufy
Skip to the page

Signing inRedeem a sign-in code

Signing in

Redeem a sign-in code

A terminal trades the page's code and its own secret for a session.

POST/api/v1/sign-in/code

verifier is the secret whose SHA-256 the terminal sent when it asked for the link. It never left the terminal before this, so the code alone, read off someone's screen, is no use.

The code lasts 10 minutes from when the button was pressed. Case, spaces and the dash don't matter. After 5 wrong codes the sign-in is used up.

On success the session arrives in Set-Cookie, never in the body, the same way the first claim's does.

Authentication

No cookie. The token in the request is the whole credential. How sessions work.

Body

JSON, with content-type: application/json.

  • verifierstringrequired

    The secret the terminal kept. Its SHA-256 is what it sent as terminal.

    • At most 200 characters
  • codestringrequired

    The code the sign-in page showed.

    • At most 40 characters

Response

200 OK, with every field below present. Times are ISO 8601 strings in UTC.

  • signedInboolean

    True when the code was right. The session comes back in Set-Cookie, never in the body.

Errors

StatusKindWhen
400bad_requestThe body isn't JSON, or doesn't match the shape below. message names the first field to fix, and fields lists each one with its path.
413payload_too_largeThe body is over 16 KB. No route takes anything near that.
429rate_limitedThis network has used 30 links and codes in the last hour.

Any route can also answer 500 with internal_error. Every error has the same shape, described in Errors.