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

# SignupPassword

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

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

![柔軟な ID を使用した Signup Password](https://mintlify.s3.us-west-1.amazonaws.com/docs-dev/images/cdy7uua7fh8z/5h85r3sVhe8mVw7rDkDwTD/02c3521d9d6c4d490c1a64ae37ecca72/Signup_Password_with_Flexible_IDs.png)

## インポート

各画面には、それぞれ固有の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,
  useExperiment,
  // 共通Hooks
  useCurrentScreen,
  useAuth0Themes,
  useErrors,
  // ユーティリティHooks
  useChangeLanguage,
  usePasswordValidation,
  // メソッド
  signup,
  federatedSignup,
  switchConnection,
  skipPassword,
} from '@auth0/auth0-acul-react/signup-password';

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

## コンテキストHooks

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

**useBranding** `() => [BrandingMembers](/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/BrandingMembers)`

このHooksは、`signup-password` 画面に表示されるロゴ、色、テーマ設定などのブランディング設定を提供します。

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

**useClient** `() => [ClientMembers](/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/ClientMembers)`

このHooksは、`signup-password` 画面の `id`、`name`、`logoUrl` など、クライアント関連の設定を提供します。

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

**useExperiment** `() => [ExperimentMembers](/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/ExperimentMembers)`

このHooksは、`signup-password` 画面で有効になっている [Experiment Center](/docs/docs/ja-jp/customize/experiment-center) の experiment を提供します。有効な experiment がない場合 (または画面が `context_configuration` でオプトインしていない場合) は `null` を返します。

```jsx Example theme={null}
import { useExperiment } from '@auth0/auth0-acul-react/signup-password';
function ExperimentBranch() {
  const experiment = useExperiment();
  if (!experiment) return null;
  return experiment.isControl ? <ControlUI /> : <TreatmentUI />;
}
```

**useOrganization** `() => [OrganizationMembers](/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/OrganizationMembers)`

このHooksは、サインアップが組織にスコープされている場合に、ユーザーの組織に関する情報を提供します。組織コンテキストが存在しない場合は `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>;
  }
}
```

**usePrompt** `() => [PromptMembers](/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/PromptMembers)`

このHooksには、認証フローにおける現在の prompt に関するデータが含まれています。

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

**useScreen** `() => [ScreenMembersOnSignupPassword](/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/ScreenMembersOnSignupPassword)`

このHooksには、設定やコンテキストなど、`signup-password` 画面に固有の詳細情報が含まれています。

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

**useTenant** `() => [TenantMembers](/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/TenantMembers)`

このHooksには、`id` や関連するメタデータなど、テナントに関するデータが含まれています。

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

**useTransaction** `() => [TransactionMembersOnSignupPassword](/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/TransactionMembersOnSignupPassword)`

このHooksは、アクティブな接続や現在のフローの状態など、`signup-password` 画面に固有のトランザクションデータを提供します。

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

**useUntrustedData** `() => [UntrustedDataMembers](/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/UntrustedDataMembers)`

このHooksは、URL パラメーターから事前入力されたメールアドレスやユーザー名など、画面に渡される信頼されていないデータを扱います。

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

**useUser** `() => [UserMembers](/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/UserMembers)`

このHooksでは、`username`、`email`、利用可能な認証方法など、現在のユーザーの詳細を取得できます。

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

**useSignupPassword** `[SignupPasswordMembers](/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/SignupPasswordMembers)`

このHooksは、`signup-password` 画面で利用可能なすべてのメソッドとコンテキストを返します。

## メソッド

**federatedSignup** `Promise\<void\>`

このメソッドは、サインアップのためにユーザーを [Social](/docs/docs/ja-jp/authenticate/identity-providers/social-identity-providers) または [Enterprise Identity Provider](/docs/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>
  );
}
```

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

**パラメータ**

**options**

[FederatedSignupPasswordPayloadOptions](/docs/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/FederatedSignupPasswordPayloadOptions).

**connection** `string` *required*

Social または Enterprise Identity Provider の接続名。

**skipPassword** `Promise\<void\>`

このメソッドは、現在のサインアップでのパスワード作成をスキップします。`screen.data.showSkipPassword` が `true` に設定されている場合にのみ利用できます。

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

function SkipPasswordButton() {
  const { skipPassword } = useSignupPassword();
  return (
    <button onClick={() => skipPassword()}>
      Skip for now
    </button>
  );
}
```

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

**パラメータ**

**options**

[SkipPasswordOptions](/docs/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/SkipPasswordOptions).

**captcha?** `string`

テナントで \[ボット検知]\(/docs/secure/attack-protection/bot-detection が有効になっている場合に必要な captcha 値。

**signup** `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>
  );
}
```

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

**パラメータ**

**options**

[SignupPasswordOptions](/docs/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/SignupPasswordOptions).

**password** `string` *required*

新しいアカウントのパスワード。

**email** `string`

ユーザーのメールアドレス。

**username** `string`

接続で必要な場合に使用する、新しいアカウントのユーザー名。

**phoneNumber** `string`

接続で必要な場合の、ユーザーの電話番号。

**captcha?** `string`

テナントでボット検出が有効になっている場合に必要な captcha 値。

**\[`key`: `string`]** `"string" | "number" | "boolean" | "undefined"`

`ulp-` で始まる追加のカスタムフィールド (例: `'ulp-custom-field'`) 。

**switchConnection** `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>
  );
}
```

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

**パラメータ**

**options**

[SwitchConnectionOptionsSignupPassword](/docs/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/SwitchConnectionOptionsSignupPassword).

**connection** `string` *required*

切り替え先の接続名。パスワードレスには `email` または `sms` を使用し、パスワードベース認証には DB 接続名を使用します。

**\[`key`: `string`]** `"string" | "number" | "boolean" | "undefined"`

`ulp-` で始まる追加のカスタムフィールド (例: `'ulp-custom-field'`) 。

## 共通/Utility Hooks

**[useAuth0Themes](/docs/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Hooks/useAuth0Themes)** `Hooks`

このフックは、ブランディングコンテキストからフラット化された設定を含む現在のテーマオプションを取得します。

**[useChangeLanguage](/docs/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Hooks/useChangeLanguage)** `Hooks`

このフックは、現在のACUL画面で表示言語を変更するための関数を返します。

**[useCurrentScreen](/docs/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Hooks/useCurrentScreen)** `Hooks`

このフックは、現在の画面のコンテキストと状態を取得します。

**[useErrors](/docs/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Hooks/useErrors)** `Hooks`

このフックは、画面上のサーバー、クライアント、および開発者のエラーを読み取って管理します。

**[usePasswordValidation](/docs/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Hooks/usePasswordValidation)** `Hooks`

このフックは、ユーザーのパスワードがテナントのパスワードポリシー要件を満たしているかどうかを検証します。
