Skip to main content
POST/gate/passkeys/signin/finish

Finish Passkey Sign-In

Completes WebAuthn passkey authentication by verifying the authenticator's assertion response, checking the signature counter for replay protection, and issuing a Gate JWT and refresh token on success.

Returns K9O_INVALID_CREDENTIALS (401) if the assertion fails or no registered passkey matches.

Parameters
projectSlug *path

The project's slug: the path segment after @.

It is unique within the org.

Request body
response *any

The browser's authentication result as JSON (an AuthenticationResponseJSON, for example what startAuthentication() from @simplewebauthn/browser returns).

Its id names the passkey, and its response.clientDataJSON names the challenge from signin/begin, which works once.

Responses
HTTPK9O CodeDescription
200Success
400K9O_INVALID_FIELD_VALUEThe passkey credential presented is not registered for this project.
401K9O_INVALID_CREDENTIALSPasskey assertion verification failed. Try again with your registered device.
401K9O_MFA_REQUIREDSign-in succeeded but an additional MFA step is required to complete authentication.
Response body (200)
data *object

Signed in.

A passkey sign-in never asks for an authenticator-app code.

session *object

The tokens for the new session.

Keep the refresh token for POST /@{projectSlug}/gate/refresh and send the access token on API calls.

accessToken *string

A signed JWT that authenticates the end user to this project's API.

Send it as Authorization: Bearer <accessToken>.

Its subject (sub) is the end user's id (eu_...), its audience (aud) is the project id (proj_...), and its issuer is the API origin of the region that holds the end user.

It lives for the project's end-user access token lifetime: 30 minutes by default, settable from 5 to 60 minutes. expiresAt is when it expires.

It cannot be revoked early: signing out or revoking sessions stops the next refresh, but a token already issued stays valid until expiresAt.

refreshToken *string

An opaque secret (43 base64url characters) that gets a new access token from POST /@{projectSlug}/gate/refresh.

Store it securely and never send it anywhere else.

It is single use: every refresh returns a new refresh token, and sending the one it replaced a second time ends the whole session.

It stops working when the session ends: on sign-out, a password reset, a revoke-all, or when the project's session limits are reached (by default 30 days without a refresh, or 90 days after sign-in, whichever comes first).

expiresAt *string <date-time>

When accessToken expires.

Refresh before this time to keep the end user signed in.

meta *any

Request metadata: cost, timing and the request and trace ids.

TypeScript
// const k9o = new K9o({ orgSlug: 'playground', projectSlug: 'storefront', apiKey: 'k9o_…' })
const { data } = await k9o.gate.passkeys.signIn.finish({
  response: null
})

Showing example in TypeScript

Request example
{
  "response": null
}
Response example (200)
{
  "data": {
    "session": {
      "accessToken": "string",
      "refreshToken": "string",
      "expiresAt": "string"
    }
  }
}

More in Sign-in & Sessions