次の方法で共有


Azure Active Directory B2C でユーザー インターフェイスをカスタマイズする

重要

2025 年 5 月 1 日より、Azure AD B2C は新規のお客様向けに購入できなくなります。 詳細については、FAQ を参照してください

開始する前にこのページの上部にある ポリシーの種類 セレクターを使用して、設定するポリシーの種類を選択します。 Azure Active Directory B2C には、ユーザーがアプリケーションを操作する方法を定義する 2 つの方法 (定義済みのユーザー フローを使用する、または完全に構成可能なカスタム ポリシーを使用する) があります。 この記事で必要な手順は、方法ごとに異なります。

Azure Active Directory B2C (Azure AD B2C) が顧客に表示するユーザー インターフェイスのブランド化とカスタマイズは、アプリケーションでシームレスなユーザー エクスペリエンスを提供するのに役立ちます。 これらのエクスペリエンスには、サインアップ、サインイン、プロファイル編集、パスワードのリセットが含まれます。 この記事では、ページ テンプレートと会社のブランドを使用して、Azure AD B2C ページをカスタマイズします。

ヒント

ページ テンプレート、バナー ロゴ、背景画像、または背景色以外のユーザー フロー ページの他の側面をカスタマイズするには、 HTML テンプレートを使用して UI をカスタマイズする方法を参照してください。

[前提条件]

概要

Azure AD B2C には、ユーザー エクスペリエンス ページをプロフェッショナルな外観にするために選択できる組み込みのテンプレートがいくつか用意されています。 これらのページ テンプレートは、 会社のブランド 化機能を使用して、独自のカスタマイズの開始点としても機能します。

クラシック テンプレートでサポートされているブラウザーには、Internet Explorer、Microsoft Edge、Google Chrome、Mozilla Firefox、Safari の最新バージョンと以前のバージョンが含まれます。 Ocean Blue および Slate Gray テンプレートでは、Internet Explorer 11 や 10 などの古いバージョンのブラウザーでサポートが制限されている場合があります。サポートするブラウザーでアプリケーションをテストすることをお勧めします。

オーシャン ブルー

サインアップとサインイン ページにレンダリングされる Ocean Blue テンプレートの例:

Ocean Blue テンプレートのスクリーンショット

スレートグレー

サインアップ サインイン ページにレンダリングされるスレート グレー テンプレートの例:

スレート グレー テンプレートのスクリーンショット

クラシック

サインアップ サインイン ページにレンダリングされるクラシック テンプレートの例:

クラシック テンプレートのスクリーンショット

会社のブランド化

Microsoft Entra ID Company ブランドを使用して、バナー ロゴ、背景画像、背景色を含む Azure AD B2C ページをカスタマイズできます。 会社のブランドには、サインアップ、サインイン、プロファイル編集、パスワードのリセットが含まれます。

次の例は、Ocean Blue テンプレートを使用したカスタム ロゴと背景画像を含む サインアップとサインイン ページを示しています。

Azure AD B2C によって提供されるブランド化されたサインアップ/サインイン ページ

ページ テンプレートを選択する

  1. Azure portal にサインインします。
  2. 複数のテナントにアクセスできる場合、上部のメニューの [設定] アイコンを選択し、[ディレクトリとサブスクリプション] メニューからお使いの Azure AD B2C テナントに切り替えます。
  3. Azure portal で、 [Azure AD B2C] を検索して選択します。
  4. ユーザーフローを選択します。
  5. カスタマイズするユーザー フローを選択します。
  6. 左側のメニューの [ カスタマイズ ] で、[ ページ レイアウト ] を選択し、[ テンプレート] を選択します。 Azure portal の [ユーザー フロー] ページの [テンプレートの選択] ドロップダウン

テンプレートを選択すると、選択したテンプレートがユーザー フロー内のすべてのページに適用されます。 各ページの URI は、[ カスタム ページ URI ] フィールドに表示されます。

ページ テンプレートを選択するには、LoadUri要素を設定します。 次の例は、コンテンツ定義識別子と対応する LoadUriを示しています。

オーシャンブルー:

<ContentDefinitions>
  <ContentDefinition Id="api.error">
    <LoadUri>~/tenant/templates/AzureBlue/exception.cshtml</LoadUri>
  </ContentDefinition>
  <ContentDefinition Id="api.idpselections">
    <LoadUri>~/tenant/templates/AzureBlue/idpSelector.cshtml</LoadUri>
  </ContentDefinition>
  <ContentDefinition Id="api.idpselections.signup">
    <LoadUri>~/tenant/templates/AzureBlue/idpSelector.cshtml</LoadUri>
  </ContentDefinition>
  <ContentDefinition Id="api.signuporsignin">
    <LoadUri>~/tenant/templates/AzureBlue/unified.cshtml</LoadUri>
  </ContentDefinition>
  <ContentDefinition Id="api.selfasserted">
    <LoadUri>~/tenant/templates/AzureBlue/selfAsserted.cshtml</LoadUri>
  </ContentDefinition>
  <ContentDefinition Id="api.selfasserted.profileupdate">
    <LoadUri>~/tenant/templates/AzureBlue/selfAsserted.cshtml</LoadUri>
  </ContentDefinition>
  <ContentDefinition Id="api.localaccountsignup">
    <LoadUri>~/tenant/templates/AzureBlue/selfAsserted.cshtml</LoadUri>
  </ContentDefinition>
  <ContentDefinition Id="api.localaccountpasswordreset">
    <LoadUri>~/tenant/templates/AzureBlue/selfAsserted.cshtml</LoadUri>
  </ContentDefinition>
  <ContentDefinition Id="api.phonefactor">
    <LoadUri>~/tenant/templates/AzureBlue/multifactor-1.0.0.cshtml</LoadUri>
  </ContentDefinition>
</ContentDefinitions>

スレート グレー:

<ContentDefinitions>
  <ContentDefinition Id="api.error">
    <LoadUri>~/tenant/templates/MSA/exception.cshtml</LoadUri>
  </ContentDefinition>
  <ContentDefinition Id="api.idpselections">
    <LoadUri>~/tenant/templates/MSA/idpSelector.cshtml</LoadUri>
  </ContentDefinition>
  <ContentDefinition Id="api.idpselections.signup">
    <LoadUri>~/tenant/templates/MSA/idpSelector.cshtml</LoadUri>
  </ContentDefinition>
  <ContentDefinition Id="api.signuporsignin">
    <LoadUri>~/tenant/templates/MSA/unified.cshtml</LoadUri>
  </ContentDefinition>
  <ContentDefinition Id="api.selfasserted">
    <LoadUri>~/tenant/templates/MSA/selfAsserted.cshtml</LoadUri>
  </ContentDefinition>
  <ContentDefinition Id="api.selfasserted.profileupdate">
    <LoadUri>~/tenant/templates/MSA/selfAsserted.cshtml</LoadUri>
  </ContentDefinition>
  <ContentDefinition Id="api.localaccountsignup">
    <LoadUri>~/tenant/templates/MSA/selfAsserted.cshtml</LoadUri>
  </ContentDefinition>
  <ContentDefinition Id="api.localaccountpasswordreset">
    <LoadUri>~/tenant/templates/MSA/selfAsserted.cshtml</LoadUri>
  </ContentDefinition>
  <ContentDefinition Id="api.phonefactor">
    <LoadUri>~/tenant/templates/MSA/multifactor-1.0.0.cshtml</LoadUri>
  </ContentDefinition>
</ContentDefinitions>

クラシック:

<ContentDefinitions>
  <ContentDefinition Id="api.error">
    <LoadUri>~/tenant/default/exception.cshtml</LoadUri>
  </ContentDefinition>
  <ContentDefinition Id="api.idpselections">
    <LoadUri>~/tenant/default/idpSelector.cshtml</LoadUri>
  </ContentDefinition>
  <ContentDefinition Id="api.idpselections.signup">
    <LoadUri>~/tenant/default/idpSelector.cshtml</LoadUri>
  </ContentDefinition>
  <ContentDefinition Id="api.signuporsignin">
    <LoadUri>~/tenant/default/unified.cshtml</LoadUri>
  </ContentDefinition>
  <ContentDefinition Id="api.selfasserted">
    <LoadUri>~/tenant/default/selfAsserted.cshtml</LoadUri>
  </ContentDefinition>
  <ContentDefinition Id="api.selfasserted.profileupdate">
    <LoadUri>~/tenant/default/selfAsserted.cshtml</LoadUri>
  </ContentDefinition>
  <ContentDefinition Id="api.localaccountsignup">
    <LoadUri>~/tenant/default/selfAsserted.cshtml</LoadUri>
  </ContentDefinition>
  <ContentDefinition Id="api.localaccountpasswordreset">
    <LoadUri>~/tenant/default/selfAsserted.cshtml</LoadUri>
  </ContentDefinition>
  <ContentDefinition Id="api.phonefactor">
    <LoadUri>~/tenant/default/multifactor-1.0.0.cshtml</LoadUri>
  </ContentDefinition>
</ContentDefinitions>

会社のブランドの構成

ユーザー フロー ページをカスタマイズするには、まず Microsoft Entra ID で会社のブランドを構成してから、Azure AD B2C のユーザー フローで有効にします。

まず、 会社のブランド内でバナーロゴ、背景画像、背景色を設定します。

  1. Azure portal にサインインします。
  2. 複数のテナントにアクセスできる場合、上部のメニューの [設定] アイコンを選択し、[ディレクトリとサブスクリプション] メニューからお使いの Azure AD B2C テナントに切り替えます。
  3. Azure portal で、 [Azure AD B2C] を検索して選択します。
  4. [ 管理] で、[ 会社のブランド] を選択します。
  5. 「組織の Microsoft Entra サインイン ページにブランドを追加する」の手順に従います。

Azure AD B2C で会社のブランドを構成するときは、次の点に注意してください。

  • 現在、Azure AD B2C での会社のブランド化は、 背景画像バナー ロゴ背景色 のカスタマイズに限定されています。 会社のブランド化ウィンドウのその他のプロパティ ( 詳細設定など) はサポートされていません。
  • ユーザー フロー ページでは、背景画像が読み込まれる前に背景色が表示されます。 スムーズな読み込みエクスペリエンスのために、背景画像の色と密接に一致する背景色を選択することをお勧めします。
  • サインアップ ユーザー フローを開始すると、ユーザーに送信された確認メールにバナー ロゴが表示されます。

ユーザー フロー ページで会社のブランド化を有効にする

会社のブランドを構成したら、ユーザー フローで有効にします。

  1. Azure portal の左側のメニューで、 Azure AD B2C を選択します。
  2. [ ポリシー] で、[ ユーザー フロー (ポリシー)] を選択します。
  3. 会社のブランド化を有効にするユーザー フローを選択します。 会社のブランド化は、標準のサインインと標準プロファイル編集ユーザー フローの種類ではサポートされていません
  4. [ カスタマイズ] で、[ ページ レイアウト] を選択し、ブランド化するページを選択します。 たとえば、[ Unified sign up or sign in page]\(統合サインアップまたはサインイン ページ\) を選択します。
  5. [ページ レイアウトのバージョン (プレビュー)] で、バージョン 1.2.0 以降を選択します。
  6. 保存 を選択します。

ユーザー フロー内のすべてのページをブランド化する場合は、ユーザー フロー内の各ページ レイアウトのページ レイアウトバージョンを設定します。

Azure portal での Azure AD B2C でのページ レイアウトの選択。

カスタム ポリシー ページで会社のブランド化を有効にする

会社のブランドを構成したら、カスタム ポリシーで有効にします。 カスタム ポリシー内のすべてのコンテンツ定義に対して、ページ contract バージョンを使用してページ レイアウト バージョンを構成します。 値の形式には、contract: urn:com:microsoft:aad:b2c:elements:contract:page-name:versionという単語が含まれている必要があります。 古い DataUri 値を使用するカスタム ポリシーでページ レイアウトを指定するには。 詳細については、ページ バージョンを使用 してページ レイアウトに移行する 方法について説明します。

次の例は、対応するページ コントラクトと Ocean Blue ページ テンプレートを含むコンテンツ定義を示しています。

<ContentDefinitions>
  <ContentDefinition Id="api.error">
    <LoadUri>~/tenant/templates/AzureBlue/exception.cshtml</LoadUri>
    <DataUri>urn:com:microsoft:aad:b2c:elements:contract:globalexception:1.2.0</DataUri>
  </ContentDefinition>
  <ContentDefinition Id="api.idpselections">
    <LoadUri>~/tenant/templates/AzureBlue/idpSelector.cshtml</LoadUri>
    <DataUri>urn:com:microsoft:aad:b2c:elements:contract:providerselection:1.2.0</DataUri>
  </ContentDefinition>
  <ContentDefinition Id="api.idpselections.signup">
    <LoadUri>~/tenant/templates/AzureBlue/idpSelector.cshtml</LoadUri>
    <DataUri>urn:com:microsoft:aad:b2c:elements:contract:providerselection:1.2.0</DataUri>
  </ContentDefinition>
  <ContentDefinition Id="api.signuporsignin">
    <LoadUri>~/tenant/templates/AzureBlue/unified.cshtml</LoadUri>
    <DataUri>urn:com:microsoft:aad:b2c:elements:contract:unifiedssp:1.2.0</DataUri>
  </ContentDefinition>
  <ContentDefinition Id="api.selfasserted">
    <LoadUri>~/tenant/templates/AzureBlue/selfAsserted.cshtml</LoadUri>
    <DataUri>urn:com:microsoft:aad:b2c:elements:contract:selfasserted:1.2.0</DataUri>
  </ContentDefinition>
  <ContentDefinition Id="api.selfasserted.profileupdate">
     <LoadUri>~/tenant/templates/AzureBlue/selfAsserted.cshtml</LoadUri>
    <DataUri>urn:com:microsoft:aad:b2c:elements:contract:selfasserted:1.2.0</DataUri>
  </ContentDefinition>
  <ContentDefinition Id="api.localaccountsignup">
     <LoadUri>~/tenant/templates/AzureBlue/selfAsserted.cshtml</LoadUri>
    <DataUri>urn:com:microsoft:aad:b2c:elements:contract:selfasserted:1.2.0</DataUri>
  </ContentDefinition>
  <ContentDefinition Id="api.localaccountpasswordreset">
     <LoadUri>~/tenant/templates/AzureBlue/selfAsserted.cshtml</LoadUri>
    <DataUri>urn:com:microsoft:aad:b2c:elements:contract:selfasserted:1.2.0</DataUri>
  </ContentDefinition>
  <ContentDefinition Id="api.phonefactor">
    <LoadUri>~/tenant/templates/AzureBlue/multifactor-1.0.0.cshtml</LoadUri>
    <DataUri>urn:com:microsoft:aad:b2c:elements:contract:multifactor:1.2.0</DataUri>
  </ContentDefinition>
</ContentDefinitions>

サインアップ フォームで入力フィールドを再配置する

ローカル アカウント フォームのサインアップ ページで入力フィールドを再配置するには、次の手順に従います。

  1. Azure portal にサインインします。
  2. 複数のテナントにアクセスできる場合、上部のメニューの [設定] アイコンを選択し、[ディレクトリとサブスクリプション] メニューからお使いの Azure AD B2C テナントに切り替えます。
  3. Azure portal で、 [Azure AD B2C] を検索して選択します。
  4. 左側のメニューで、[ ユーザー フロー] を選択します。
  5. 入力フィールドを再配置するユーザー フロー (ローカル アカウントのみ) を選択します。
  6. 左側のメニューで、[ページ レイアウト] を選択します
  7. テーブルで、[ ローカル アカウントのサインアップ] ページの行を選択します。
  8. [ ユーザー属性] で、並べ替える入力フィールドを選択し、ドラッグ (上または下) して、[上へ 移動 ] または [ 下へ移動 ] コントロールを使用して目的の順序を設定します。
  9. ページの最上部で [保存] を選択します。

Azure portal の [ユーザー フロー] ページの [テンプレートの選択] ドロップダウン。

アプリケーションのユーザー インターフェイスをカスタマイズする方法の詳細については、「 Azure Active Directory B2C でアプリケーションのユーザー インターフェイスをカスタマイズする」を参照してください。