> ## 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.

# SignupPassword

> Universal Login の `signup-password` 画面をカスタマイズするために使用できる、すべてのHooksとメソッドについて説明します。

`signup-password` 画面では、アカウント作成を完了するためにユーザーのパスワードを収集します。これは複数ステップのサインアップフローの第2ステップで、識別子の収集に続くものです。また、ソーシャルまたはエンタープライズ接続を介したフェデレーションによるサインアップにも対応しています。

<Frame>
  <img style={{maxHeight:"400px"}} src="https://mintcdn.com/translations/MV7tE-x71x8RWRES/docs/images/cdy7uua7fh8z/5h85r3sVhe8mVw7rDkDwTD/02c3521d9d6c4d490c1a64ae37ecca72/Signup_Password_with_Flexible_IDs.png?fit=max&auto=format&n=MV7tE-x71x8RWRES&q=85&s=0b8269a168708f6d69d5d1563d0a533a" alt="柔軟な ID を使用した Signup Password" width="480" height="1032" data-path="docs/images/cdy7uua7fh8z/5h85r3sVhe8mVw7rDkDwTD/02c3521d9d6c4d490c1a64ae37ecca72/Signup_Password_with_Flexible_IDs.png" />
</Frame>

<div id="import">
  ## インポート
</div>

各画面には、それぞれ固有のHooksとメソッドがあります。SDK は、各画面について **partial import** と **root import** をサポートしています。

* partial import を使用すると、特定の用途に必要なコードだけを含めることができます。
* root import を使用すると、単一のバンドルからすべての画面を読み込めるため、想定されるすべての画面に対応する統一されたビルドが必要な場合に便利です。

```jsx Import Example theme={null}
// ルートインポート
import { useSignupPassword } from '@auth0/auth0-acul-react';

// 部分インポート
import {
  useSignupPassword,
  // コンテキストHooks
  useUser,
  useTenant,
  useBranding,
  useClient,
  useOrganization,
  usePrompt,
  useScreen,
  useTransaction,
  useUntrustedData,
  // 共通Hooks
  useCurrentScreen,
  useAuth0Themes,
  useErrors,
  // ユーティリティHooks
  useChangeLanguage,
  usePasswordValidation,
  // メソッド
  signup,
  federatedSignup,
  switchConnection,
} from '@auth0/auth0-acul-react/signup-password';

function SignupPasswordForm() {
  const { signup } = useSignupPassword();
  return (
    <button onClick={() => signup({ password: 'secret' })}>
      Create Account
    </button>
  );
}
```

<div id="context-hooks">
  ## コンテキストHooks
</div>

`signup-password` 画面で Auth0 のコンテキストデータへの読み取り専用アクセスを提供する、画面にスコープが設定されたHooksです。`@auth0/auth0-acul-react/signup-password` からインポートします。

<ParamField body="useBranding" type={<span>() =&gt; <a href="/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/BrandingMembers">BrandingMembers</a></span>}>
  このフックは、`signup-password` 画面に表示されるロゴ、色、テーマ設定などのブランディング設定を提供します。

  ```jsx Example theme={null}
  import { useBranding } from '@auth0/auth0-acul-react/signup-password';
  function CustomTheme() {
    const branding = useBranding();
  }
  ```
</ParamField>

<ParamField body="useClient" type={<span>() =&gt; <a href="/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/ClientMembers">ClientMembers</a></span>}>
  このフックは、`signup-password` 画面の `id`、`name`、`logoUrl` など、クライアント関連の設定を提供します。

  ```jsx Example theme={null}
  import { useClient } from '@auth0/auth0-acul-react/signup-password';
  function AppInfo() {
    const client = useClient();
  }
  ```
</ParamField>

<ParamField body="useOrganization" type={<span>() =&gt; <a href="/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/OrganizationMembers">OrganizationMembers</a></span>}>
  このフックは、サインアップが組織にスコープされている場合に、ユーザーの組織に関する情報を提供します。組織コンテキストが存在しない場合は `null` を返します。

  ```jsx Example theme={null}
  import { useOrganization } from '@auth0/auth0-acul-react/signup-password';
  function OrgSelector() {
    const organization = useOrganization();
    if (!organization) {
      return <p>No organization context</p>;
    }
  }
  ```
</ParamField>

<ParamField body="usePrompt" type={<span>() =&gt; <a href="/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/PromptMembers">PromptMembers</a></span>}>
  このフックには、認証フローにおける現在の prompt に関するデータが含まれています。

  ```jsx Example theme={null}
  import { usePrompt } from '@auth0/auth0-acul-react/signup-password';
  function FlowInfo() {
    const prompt = usePrompt();
  }
  ```
</ParamField>

<ParamField body="useScreen" type={<span>() =&gt; <a href="/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/ScreenMembersOnSignupPassword">ScreenMembersOnSignupPassword</a></span>}>
  このフックには、設定やコンテキストなど、`signup-password` 画面に固有の詳細情報が含まれています。

  ```jsx Example theme={null}
  import { useScreen } from '@auth0/auth0-acul-react/signup-password';
  function ScreenDebug() {
    const screen = useScreen();
  }
  ```
</ParamField>

<ParamField body="useTenant" type={<span>() =&gt; <a href="/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/TenantMembers">TenantMembers</a></span>}>
  このフックには、`id` や関連するメタデータなど、テナントに関するデータが含まれています。

  ```jsx Example theme={null}
  import { useTenant } from '@auth0/auth0-acul-react/signup-password';
  function TenantInfo() {
    const tenant = useTenant();
  }
  ```
</ParamField>

<ParamField body="useTransaction" type={<span>() =&gt; <a href="/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/TransactionMembersOnSignupPassword">TransactionMembersOnSignupPassword</a></span>}>
  このフックは、アクティブな接続や現在のフローの状態など、`signup-password` 画面に固有のトランザクションデータを提供します。

  ```jsx Example theme={null}
  import { useTransaction } from '@auth0/auth0-acul-react/signup-password';
  function TransactionInfo() {
    const transaction = useTransaction();
  }
  ```
</ParamField>

<ParamField body="useUntrustedData" type={<span>() =&gt; <a href="/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/UntrustedDataMembers">UntrustedDataMembers</a></span>}>
  このフックは、事前入力されたメールアドレスや URLパラメーター から渡されるユーザー名など、画面に渡された信頼できないデータを扱います。

  ```jsx Example theme={null}
  import { useUntrustedData } from '@auth0/auth0-acul-react/signup-password';
  function PrefilledForm() {
    const untrustedData = useUntrustedData();
  }
  ```
</ParamField>

<ParamField body="useUser" type={<span>() =&gt; <a href="/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/UserMembers">UserMembers</a></span>}>
  このフックでは、`username`、`email`、利用可能な認証方法など、現在のユーザーの詳細を取得できます。

  ```jsx Example theme={null}
  import { useUser } from '@auth0/auth0-acul-react/signup-password';
  function UserProfile() {
    const user = useUser();
  }
  ```
</ParamField>

<ParamField body="useSignupPassword" type={<a href="/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/SignupPasswordMembers">SignupPasswordMembers</a>}>
  このフックは、`signup-password` 画面で利用可能なすべてのメソッドとコンテキストを返します。
</ParamField>

<div id="methods">
  ## メソッド
</div>

<ParamField body="federatedSignup" type="Promise<void>">
  このメソッドは、サインアップのためにユーザーを [Social](/docs/ja-jp/authenticate/identity-providers/social-identity-providers) または [Enterprise Identity Provider](/docs/ja-jp/authenticate/identity-providers/enterprise-identity-providers) (IdP) にリダイレクトします。

  ```jsx Example theme={null}
  import { useSignupPassword } from '@auth0/auth0-acul-react/signup-password';

  function SocialButton() {
    const { federatedSignup } = useSignupPassword();
    return (
      <button onClick={() => federatedSignup({ connection: 'google-oauth2' })}>
        Sign up with Google
      </button>
    );
  }
  ```

  **メソッドのパラメータ**

  <Expandable title="パラメータ">
    <ParamField body="options">
      [FederatedSignupPasswordPayloadOptions](/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/FederatedSignupPasswordPayloadOptions).
    </ParamField>

    <ParamField body="connection" type="string" required>
      Social または Enterprise Identity Provider の接続名。
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="signup" type="Promise<void>">
  このメソッドは、アカウント作成を完了するためにユーザーのパスワードを送信します。

  ```jsx Example theme={null}
  import { useSignupPassword } from '@auth0/auth0-acul-react/signup-password';

  function SignupPasswordForm() {
    const { signup } = useSignupPassword();
    return (
      <button onClick={() => signup({ password: 'secret' })}>
        Create Account
      </button>
    );
  }
  ```

  **メソッドのパラメータ**

  <Expandable title="パラメータ">
    <ParamField body="options">
      [SignupPasswordOptions](/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/SignupPasswordOptions).
    </ParamField>

    <ParamField body="password" type="string" required>
      新しいアカウントのパスワード。
    </ParamField>

    <ParamField body="email" type="string">
      ユーザーのメールアドレス。
    </ParamField>

    <ParamField body="username" type="string">
      接続で必要な場合に使用する、新しいアカウントのユーザー名。
    </ParamField>

    <ParamField body="phoneNumber" type="string">
      接続で必要な場合の、ユーザーの電話番号。
    </ParamField>

    <ParamField body="captcha?" type="string">
      テナントでボット検出が有効になっている場合に必要な captcha 値。
    </ParamField>

    <ParamField body="[`key`: `string`]" type="&#x22;string&#x22; | &#x22;number&#x22; | &#x22;boolean&#x22; | &#x22;undefined&#x22;">
      `ulp-` で始まる追加のカスタムフィールド (例: `'ulp-custom-field'`) 。
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="switchConnection" type="Promise<void>">
  このメソッドは、signup-password ステップ中にアクティブな接続を切り替え、ユーザーが別の接続で認証できるようにします。

  ```jsx Example theme={null}
  import { useSignupPassword } from '@auth0/auth0-acul-react/signup-password';

  function SwitchConnection() {
    const { switchConnection } = useSignupPassword();
    return (
      <button onClick={() => switchConnection({ connection: 'Username-Password-Authentication' })}>
        Use a different method
      </button>
    );
  }
  ```

  **メソッドのパラメータ**

  <Expandable title="パラメータ">
    <ParamField body="options">
      [SwitchConnectionOptionsSignupPassword](/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/SwitchConnectionOptionsSignupPassword).
    </ParamField>

    <ParamField body="connection" type="string" required>
      切り替え先の接続名。パスワードレスには `email` または `sms` を使用し、パスワードベース認証には DB 接続名を使用します。
    </ParamField>

    <ParamField body="[`key`: `string`]" type="&#x22;string&#x22; | &#x22;number&#x22; | &#x22;boolean&#x22; | &#x22;undefined&#x22;">
      `ulp-` で始まる追加のカスタムフィールド (例: `'ulp-custom-field'`) 。
    </ParamField>
  </Expandable>
</ParamField>

<div id="commonutility-hooks">
  ## 共通/Utility Hooks
</div>

<ParamField body={<a href="/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Hooks/useAuth0Themes">useAuth0Themes</a>} type="Hooks">
  このフックは、ブランディングコンテキストからフラット化された設定を含む現在のテーマオプションを取得します。
</ParamField>

<ParamField body={<a href="/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Hooks/useChangeLanguage">useChangeLanguage</a>} type="Hooks">
  このフックは、現在のACUL画面で表示言語を変更するための関数を返します。
</ParamField>

<ParamField body={<a href="/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Hooks/useCurrentScreen">useCurrentScreen</a>} type="Hooks">
  このフックは、現在の画面のコンテキストと状態を取得します。
</ParamField>

<ParamField body={<a href="/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Hooks/useErrors">useErrors</a>} type="Hooks">
  このフックは、画面上のサーバー、クライアント、および開発者のエラーを読み取って管理します。
</ParamField>

<ParamField body={<a href="/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Hooks/usePasswordValidation">usePasswordValidation</a>} type="Hooks">
  このフックは、ユーザーのパスワードがテナントのパスワードポリシー要件を満たしているかどうかを検証します。
</ParamField>
