> ## Documentation Index
> Fetch the complete documentation index at: https://translations.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# パスキーで新規ユーザーを登録する

> サインアップ時に新規ユーザーのパスキー登録を開始します。WebAuthn の作成パラメータと、登録完了に必要な `auth_session` を返します。

<div id="endpoint">
  ## Endpoint
</div>

`POST /passkey/register`

サインアップ時に新規ユーザーのパスキー登録を開始します。このエンドポイントはパスキー登録セッションを作成し、指定されたユーザープロファイルをデータベース接続のサインアップ属性に照らして検証したうえで、アプリケーションからプラットフォーム認証器に渡すWebAuthnの作成パラメータを返します。認証器からアテステーションが返された後、パスキーグラントを使用して`/oauth/token`でアサーションを交換することで、登録を完了します。

<div id="remarks">
  ### 注記
</div>

* アプリケーションの[グラントタイプ](/docs/ja-jp/get-started/applications/application-settings#grant-types)に、`urn:okta:params:oauth:grant-type:webauthn` が含まれている必要があります。
* アプリケーションは[ファーストパーティアプリケーション](https://auth0.com/docs/get-started/applications/confidential-and-public-applications)である必要があります。サードパーティアプリケーションによるこのエンドポイントの呼び出しは許可されていません。
* アプリケーションは OIDC 準拠である必要があります。
* リクエストは、テナント用に構成された[カスタムドメイン](https://auth0.com/docs/customize/custom-domains)に対して行う必要があります。デフォルトの Auth0 ドメイン (`{tenant}.auth0.com`) への呼び出しは拒否されます。
* `user_profile` には、接続でサインアップ時に `required` とマークされているすべての識別子 (通常は `email`、`phone_number`、または `username`) を含める必要があります。追加の識別子は `optional` にできます。
* ユーザーは、構成されているいずれかの識別子によって既存ユーザーとして判定されます。送信された識別子のいずれかが既存のユーザーに一致した場合、リクエストは `invalid_request` で失敗します。

<div id="request-body">
  ## リクエスト本文
</div>

<ParamField body="client_id" type="string" required>
  アプリケーションの `client_id`。
</ParamField>

<ParamField body="client_secret" type="string">
  アプリケーションの `client_secret`。`client_secret_post` トークンエンドポイント認証方式を使用する機密アプリケーションでは必須です。
</ParamField>

<ParamField body="realm" type="string">
  ユーザーがサインアップするデータベース接続の名前。省略した場合、Auth0 はそのアプリケーションに対してテナントのデフォルトのデータベース接続を使用します。
</ParamField>

<ParamField body="organization" type="string">
  ユーザーがサインインする[Auth0 Organization](https://auth0.com/docs/manage-users/organizations)の ID。アプリケーションの `organization_usage` が `require` に設定されている場合は必須です。
</ParamField>

<ParamField body="user_profile" type="object" required>
  新規ユーザーのプロファイル属性。プロパティは、データベース接続で設定されたサインアップ属性 (`required` および `optional`) と一致している必要があります。認識されないプロパティが含まれている場合、リクエストは `invalid_request` で失敗します。

  <Expandable title="プロパティ">
    <ParamField body="email" type="string">
      ユーザーのメールアドレス。
    </ParamField>

    <ParamField body="phone_number" type="string">
      E.164形式のユーザーの電話番号 (1～30文字、国際 `+` プレフィックス) 。例：`+14155552671`。
    </ParamField>

    <ParamField body="username" type="string">
      ユーザーのユーザー名。接続のユーザー名ポリシー (長さおよび使用可能な文字) に基づいて検証されます。
    </ParamField>

    <ParamField body="name" type="string">
      氏名 (1～300文字) 。
    </ParamField>

    <ParamField body="given_name" type="string">
      名 (1～150文字) 。
    </ParamField>

    <ParamField body="family_name" type="string">
      姓 (1～150文字) 。
    </ParamField>

    <ParamField body="nickname" type="string">
      ニックネーム (1～300文字) 。
    </ParamField>

    <ParamField body="picture" type="string">
      ユーザーのプロフィール画像を示すURL。
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="user_metadata" type="object">
  新規ユーザーに付加する任意のユーザーメタデータ。文字列フィールドは最大10個です。
</ParamField>

<div id="response">
  ## レスポンス
</div>

成功時のレスポンスには、WebAuthn の作成パラメータと、後続のアテステーションをこの登録リクエストに紐付ける `auth_session` 値が含まれます。

<ResponseField name="auth_session" type="string">
  不透明なセッション識別子。パスキー登録を完了するトークン交換リクエストで渡します。
</ResponseField>

<ResponseField name="authn_params_public_key" type="object">
  プラットフォーム認証器で呼び出す WebAuthn `PublicKeyCredentialCreationOptions`。

  <Expandable title="プロパティ">
    <ResponseField name="challenge" type="string">
      アテステーション時に認証器が署名する、Auth0 によって生成されたチャレンジ。
    </ResponseField>

    <ResponseField name="timeout" type="integer">
      チャレンジの有効期間 (ミリ秒) 。
    </ResponseField>

    <ResponseField name="rp" type="object">
      Relying Party のアイデンティティ。

      <Expandable title="プロパティ">
        <ResponseField name="id" type="string">
          Relying Party 識別子 (RP ID) 。デフォルトでは、テナントのカスタムドメインまたは設定済みのカスタム Relying Party 識別子が使用されます。
        </ResponseField>

        <ResponseField name="name" type="string">
          Relying Party の表示名。`rp.id` と同じ値が返されます。
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="user" type="object">
      新しい資格情報を紐付ける WebAuthn ユーザーハンドル。

      <Expandable title="プロパティ">
        <ResponseField name="id" type="string">
          サーバーによって生成されたユーザーハンドル。
        </ResponseField>

        <ResponseField name="name" type="string">
          ユーザーに表示する識別子 (通常は、`email` など `user_profile` で指定された最優先の値) 。
        </ResponseField>

        <ResponseField name="displayName" type="string">
          表示名 (指定されている場合は `user_profile.name`、それ以外の場合は選択された識別子) 。
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="pubKeyCredParams" type="array">
      許可される資格情報の[公開鍵アルゴリズム](/docs/ja-jp/get-started/applications/signing-algorithms)を優先順に示します。Auth0 は EdDSA (`-8`) 、ES256 (`-7`) 、RS256 (`-257`) を返します。
    </ResponseField>

    <ResponseField name="authenticatorSelection" type="object">
      認証器の選択条件。

      <Expandable title="プロパティ">
        <ResponseField name="residentKey" type="string">
          常駐キーの要件。常に `required` が返されます。
        </ResponseField>

        <ResponseField name="userVerification" type="string">
          ユーザー検証の要件。常に `preferred` が返されます。
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

| ステータス | 説明                                                                                                                                                                                                    |
| ----- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 200   | 登録チャレンジが正常に生成されました。                                                                                                                                                                                   |
| 400   | 無効なリクエスト。一般的な原因には、必須の `user_profile` 識別子の欠落、無効な `user_profile` フィールド、無効な `user_metadata` フィールド、ユーザーがすでに存在すること、アプリケーションがパスキー認証用に設定されていないこと、カスタムドメインに対してリクエストが行われていないこと、またはアプリケーションがサードパーティであることが含まれます。 |
| 401   | 未認可。クライアント資格情報が無効です。                                                                                                                                                                                  |
| 404   | テナントで Passkey API が有効になっていません。                                                                                                                                                                        |
| 429   | リクエストが多すぎます。IP ごとのレート制限を超過しました。                                                                                                                                                                       |
