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

# LoginId

> Universal Login の `login-id` 画面をカスタマイズするために利用できる、すべてのプロパティとメソッドについて説明します。

LoginId クラスは、`login-id` 画面の機能を実装します。この画面では、identifier 優先の認証フローの最初のステップとしてユーザーの identifier を収集します。テナントによっては、この identifier としてメールアドレス、電話番号、またはユーザー名を使用できます。パスキーログイン、フェデレーテッド ID プロバイダー、Google One Tap もサポートしています。

![](https://mintlify.s3.us-west-1.amazonaws.com/docs-dev/images/cdy7uua7fh8z/1nvMFmxC5ODCW2q7cByHv8/657d87ba1c2eb11316e6b0ef93737c99/LoginIDACUL.png)

## コンストラクタ

LoginId 画面マネージャーのインスタンスを作成します:

```typescript Example theme={null}
import LoginId from "@auth0/auth0-acul-js/login-id";
const loginIdManager = new LoginId();
loginIdManager.getLoginIdentifiers();
```

## プロパティ

**branding** `[BrandingMembers](/docs/ja-jp/libraries/acul/js-sdk/Screens/interfaces/BrandingMembers)`

ブランディングテーマや設定など、ブランディングに関連する設定を提供します。

**client** `[ClientMembers](/docs/ja-jp/libraries/acul/js-sdk/Screens/interfaces/ClientMembers)`

`login-id` 画面向けに、`id`、`name`、`logoUrl` などのクライアント関連の設定を提供します。

**countryCodes** `[CountryCodesMembers](/docs/ja-jp/libraries/acul/js-sdk/Screens/interfaces/CountryCodesMembers)`

`login-id` 画面での電話番号入力用に、`available` や `recommended` などの国コードデータを提供します。

**experiment** `[ExperimentMembers](/docs/ja-jp/libraries/acul/js-sdk/Screens/interfaces/ExperimentMembers)`

この画面で現在アクティブな [Experiment Center](/docs/docs/ja-jp/customize/experiment-center) の experiment です。アクティブな experiment がない場合 (または画面が `context_configuration` でオプトインしていない場合) は `null` になります。

**organization** `[OrganizationMembers](/docs/ja-jp/libraries/acul/js-sdk/Screens/interfaces/OrganizationMembers)`

ユーザーの組織に関する情報 (`id` や `name` など) を提供します。

**prompt** `[PromptMembers](/docs/ja-jp/libraries/acul/js-sdk/Screens/interfaces/PromptMembers)`

認証フローにおける現在のプロンプトに関するデータを含みます。

**screen** `[ScreenMembersOnLoginId](/docs/ja-jp/libraries/acul/js-sdk/Screens/interfaces/ScreenMembersOnLoginId)`

設定やコンテキストを含む、`login-id` 画面固有の詳細を含みます。

**tenant** `[TenantMembers](/docs/ja-jp/libraries/acul/js-sdk/Screens/interfaces/TenantMembers)`

`id` や関連するメタデータなど、テナント に関連するデータを含みます。

**transaction** `[TransactionMembersOnLoginId](/docs/ja-jp/libraries/acul/js-sdk/Screens/interfaces/TransactionMembersOnLoginId)`

アクティブな identifier やフローの状態など、`login-id` 画面に固有のトランザクション データを提供します。

**untrustedData** `[UntrustedDataMembers](/docs/ja-jp/libraries/acul/js-sdk/Screens/interfaces/UntrustedDataMembers)`

ログイン時のユーザー入力など、SDK に渡される信頼されていないデータを扱います。

**user** `[UserMembers](/docs/ja-jp/libraries/acul/js-sdk/Screens/interfaces/UserMembers)`

アクティブなユーザーの詳細 (`username`、`email`、`roles` など) を含みます。

## メソッド

**changeLanguage** `Promise\<void\>`

このメソッドは、Universal Login ページの表示言語を変更します。

```typescript Example theme={null}
import LoginId from "@auth0/auth0-acul-js/login-id";
const loginIdManager = new LoginId();
loginIdManager.changeLanguage({
  language: 'fr',
});
```

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

**パラメータ**

**options**

[LanguageChangeOptions](/docs/docs/ja-jp/libraries/acul/js-sdk/Screens/interfaces/LanguageChangeOptions)。

**language** `string` *required*

変更先の言語のロケールコードです (例: `'en'`、`'fr'`、`'es'`) 。

**persist?** `"session"`

`'session'` に設定すると、選択した言語はセッション中保持されます。

**federatedLogin** `Promise\<void\>`

このメソッドは、認証のためにユーザーを[ソーシャル](/docs/docs/ja-jp/authenticate/identity-providers/social-identity-providers)または[エンタープライズ IDプロバイダー](/docs/docs/ja-jp/authenticate/identity-providers/enterprise-identity-providers) (IdP) にリダイレクトします。

```typescript Example theme={null}
import LoginId from "@auth0/auth0-acul-js/login-id";
const loginIdManager = new LoginId();
loginIdManager.federatedLogin({
  connection: "google-oauth2"
});
```

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

**パラメータ**

**connection** `string` *required*

ソーシャルまたはエンタープライズ IDプロバイダーの接続名です。

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

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

**getErrors** `[Error](/docs/ja-jp/libraries/acul/js-sdk/Screens/interfaces/Error)[]`

このメソッドは、コンテキストからトランザクションのエラー配列を取得します。存在しない場合は空の配列を返します。トランザクションのコンテキストに含まれるエラーオブジェクトの配列です。

**getLoginIdentifiers** `[ScreenIdentifierType](/docs/ja-jp/libraries/acul/js-sdk/Screens/type-aliases/ScreenIdentifierType)[] | null`

このメソッドは、login-id 画面で有効になっている identifier タイプを取得します。

```typescript Example theme={null}
import LoginId from "@auth0/auth0-acul-js/login-id";
const loginIdManager = new LoginId();
loginIdManager.getLoginIdentifiers();
```

**login** `Promise\<void\>`

このメソッドは、ユーザーにユーザー名の入力を求めます。

```typescript Example theme={null}
import LoginId from "@auth0/auth0-acul-js/login-id";
const loginIdManager = new LoginId();
loginIdManager.login({
  username: "testUser"
});
```

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

**パラメータ**

**options**

[LoginOptions](/docs/docs/ja-jp/libraries/acul/js-sdk/Screens/interfaces/LoginOptions)。

**identifier?** `string`

ユーザーの identifier です。`identifierType` に応じて email、username、または電話番号になります。これまたは `username` を指定してください。両方を指定した場合は、`identifier` が優先されます。

**username?** `string`

元のスペルで指定するユーザーの identifier です。これまたは `identifier` を指定してください。

**identifierType?** `[IdentifierType](/docs/ja-jp/libraries/acul/js-sdk/Screens/type-aliases/IdentifierType)`

`identifier` (または `username`) に格納される値の種類です。通常は `screen.data.activeIdentifierType` から読み取ります。identifier を型指定せずに送信する場合は省略してください。

**phoneCountryCode?** `string`

電話番号の identifier に使用する ISO 3166-1 alpha-2 国コードです。`countryCodes.available` の `code` から指定します。`identifierType` が `phone` の場合は必須です。国内番号を渡してください。ダイヤルコードはサーバー側で先頭に付加されます。

**captcha?** `string`

captcha の code、または CAPTCHA provider からのレスポンスです。Auth0 テナントで [ボット検出](/docs/docs/ja-jp/secure/attack-protection/bot-detection) が有効になっている場合、このプロパティは必須です。

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

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

**passkeyLogin** `Promise\<void\>`

このメソッドは、指定されたパスキーを使用してユーザーを認証し、成功すると `redirect_url` にリダイレクトします。

```typescript Example theme={null}
import LoginId from "@auth0/auth0-acul-js/login-id";
const loginIdManager = new LoginId();
loginIdManager.passkeyLogin();
```

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

**パラメータ**

**options**

[CustomOptions](/docs/docs/ja-jp/libraries/acul/js-sdk/Screens/interfaces/CustomOptions)。

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

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

**googleOneTap** `Promise\<void\>`

このメソッドは、Google One Tap 認証情報を使用してユーザーを認証し、別の login ページにリダイレクトすることなくワンクリックでのサインインを可能にします。

Google One Tap プロンプトを表示する前に `screen.googleOneTapConfig` を確認してください。この機能がサーバー側で有効になっていない場合は `null` です。

```typescript Example theme={null}
import LoginId from "@auth0/auth0-acul-js/login-id";
const loginIdManager = new LoginId();
loginIdManager.googleOneTap({ one_tap_credential: credential });
```

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

**パラメータ**

**one\_tap\_credential** `string` *required*

Google Identity Services プロンプトから返される Google One Tap 認証情報トークンです。

**pickCountryCode** `Promise\<void\>`

このメソッドは、ユーザーを国コード選択リストにリダイレクトし、そこで電話番号の国コードプレフィックスを更新できます。

```typescript Example theme={null}
import LoginId from "@auth0/auth0-acul-js/login-id";
const loginIdManager = new LoginId();
loginIdManager.pickCountryCode();
```

**registerPasskeyAutofill** `Promise\<void\>`

このメソッドは、`mediation: conditional` を指定した `navigator.credentials.get()` を使用して、受動的な WebAuthn 資格情報リクエストを初期化します。サポートされている場合、ブラウザーは保存済みのパスキーをユーザー名フィールドの autocomplete ドロップダウンに直接表示できます。

```typescript Example theme={null}
import LoginId from '@auth0/auth0-acul-js/login-id';

async function initializeLogin() {
  const loginId = new LoginId();
  await loginId.registerPasskeyAutofill('username');
}

initializeLogin().catch(console.error);
```

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

**パラメータ**

**inputId?** `string`

ユーザー名 `<input>` 要素の省略可能な ID (`#` なし) 。例: `"username"`。省略した場合、入力要素に正しい `autocomplete` 属性が設定されていることを、開発者が手動で確認する必要があります。
