---
title: "Initialize WebAuthn registration"
method: POST
path: "/webauthn/registration/initialize"
tags: ["WebAuthn"]
deprecated: true
---

# Initialize WebAuthn registration

`POST /webauthn/registration/initialize`

> **Deprecated.**

Initialize a registration with Webauthn. Returns a JSON representation of CredentialCreationOptions for use
with the Webauthn API's `navigator.credentials.create()`.

*Note*: The Webauthn API uses binary data represented by ArrayBuffers for certain input/output values.
The Hanko API returns these values as base64url-encoded, so they must be converted to ArrayBuffers
when passed to the Webauthn API. Similarly, Webauthn API output must be converted to base64url-encoded values
when passed to the Hanko API (e.g. using the [webauthn-json](https://github.com/github/webauthn-json) library).

## Response `200`

Challenge

- CredentialCreationOptions — Options for credential creation with the WebAuthn API
  - `publicKey` object
    - `rp` object
      - `name` string
      - `id` string
    - `user` object
      - `id` string
      - `name` string
      - `displayName` string
    - `challenge` string, base64url
    - `pubKeyCredParams` object[]
      - `type` 'public-key'
      - `alg` number
    - `timeout` integer
    - `authenticatorSelection` object
      - `authenticatorAttachment` 'platform' | 'cross-platform'
      - `requireResidentKey` boolean
      - `residentKey` 'discouraged' | 'preferred' | 'required'
      - `userVerification` 'discouraged' | 'preferred' | 'required'
    - `attestation` 'none' | 'indirect' | 'direct' | 'enterprise'

## Other responses

- `400` — Bad Request
- `422` — Unprocessable Entity
- `500` — Internal server error

---

[API](https://skmtc.net/hanko/apis/hanko-admin-api.md) · [All operations](https://skmtc.net/hanko/apis/hanko-admin-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/hanko/hanko-admin-api/versions/d22a127b0978/schema)
