サインアップとサインイン ユーザー フローを作成する

完了

演習 - サインアップとサインインのユーザー フローを作成する

ユーザー フローは、ユーザーが従う一連のサインアップ手順と、ユーザーが使用できるサインイン方法 (メールとパスワード、ワンタイム パスコード、Google または Facebook のソーシャル アカウントなど) を定義します。 また、一連の組み込みユーザー属性から選択するか、独自のカスタム属性を追加することで、サインアップ時に顧客から情報を収集することもできます。 顧客に提供する複数のアプリケーションがある場合は、複数のユーザー フローを作成できます。

Note

ユーザー フローを作成するには、少なくとも外部 ID ユーザー フロー管理者ディレクトリ ロールが必要です。

フィードバックがありますか? ご自身の概念実証プロジェクトがどのように進んでいるかをお知らせください。 ご意見をお聞かせください!

  1. サインアップとサインインのユーザー フローを作成するには、Microsoft Entra 管理センターにサインインし、[ID]>[External Identities] に移動します。

    Microsoft Entra 管理センターホームページのスクリーンショット。[External Identities] というタイトルの左側のナビゲーション項目が強調表示されています。

  2. メニューから [ユーザー フロー] を選択します。 次に、[新しいユーザー フロー] を選択します。

    Microsoft Entra 管理センターホームページのスクリーンショット。[External Identities] というタイトルの左側のナビゲーション項目が強調表示されています。

  3. [作成] ページで、ユーザー フローの [名前] を入力します (例: "SignUpSignIn")。 次に、[ID プロバイダー] で、[Email アカウント] チェック ボックスをオンにし、これらのオプションのいずれかを選択します。 他の ID プロバイダーを構成した場合は、それらを選択できます。

    [External Identities ユーザー フロー] の [作成] ブレードのスクリーンショット。新しいユーザー フローの名前が強調表示されいる。

  4. [ユーザー属性] で、サインアップ時にユーザーから収集する属性を選択します。 [もっと表示] を選択して、役職、表示名、郵便番号などの属性の完全な一覧から選択します。 次に、[作成] を選択してユーザー フローを作成します。

    [External Identities User flows (External Identities ユーザー フロー) の [作成] ブレードのスクリーンショット。サインアップ時に収集する属性として [City]、[Country or Region]、および [Display Name as attributes] のチェック ボックスでオンになっている項目が強調表示され、その下に追加のオプションが表示されます。下部にある [作成] というタイトルのボタンが強調表示されています。

  5. 一覧から、作成したユーザー フローを選択します。

    グリッド一覧で SignUpSignIn というタイトルのユーザー フローが強調表示されている [External Identities User flows] (External Identities ユーザーフロー) ブレードのスクリーンショット。

  6. 次の手順では、アプリケーションにアクセスするユーザーのサインアップおよびサインイン エクスペリエンス (ユーザー フロー) をアクティブにします。 左側のメニューで、 [使用] の下の [アプリケーション] を選択します。

    SignUpSignIn というタイトルのユーザー フローの [ユーザー フローの概要] ブレードのスクリーンショット。左側のナビゲーション 項目の [Applications] が強調表示されています。

  7. [アプリケーションの追加] を選択します。

    タイトルが SignUpSignIn のユーザー フローの [Applications] ブレードのスクリーンショット。[Add application] というタイトルのツール バー ボタンが強調表示されています。

  8. 一覧からアプリケーションを選択します。 または、検索ボックスを使用してアプリケーションを検索し、それを選択します。 [選択] を選択します。

    [アプリケーションの選択] ウィンドウのスクリーンショット。選択された Woodgrove Groceries というタイトルのアプリケーションが右側に開き、強調表示されています。下部にある [選択] というタイトルのボタンが強調表示されています。

  9. これで、アプリケーションがユーザー フローにリンクされました。 ユーザー フローの実行を選択し、エクスペリエンスをプレビューします。

    Woodgrove Groceries というタイトルのアプリケーションのスクリーンショット。SignUpSignIn というタイトルのユーザー フローに関連付けられたアプリケーションとして表示されます。ラベル [ユーザー フローの実行] 付きボタンが強調表示されます。

  10. 右側に表示されるユーザー フローの実行ペインで、正しいアプリケーション応答 URL が選択されていることを確認します。 その後、ユーザー フローの実行を選択します。

    [アプリケーション] フィールドと [応答 URL] フィールドが強調表示された、右側に表示される [ユーザー フローの実行] ペインのスクリーンショット。下部では、ラベル [ユーザー フローの実行] 付きボタンも強調表示されます。

  11. お疲れさまでした。 正常にユーザー フローを作成し、アプリケーションをリンクしました!

    ヒント

    いつでもユーザー フローの実行ボタンで、サインイン エクスペリエンスをプレビューできます。 ユーザーが食料品 Web サイトにサインインすると、ユーザー フローで構成されたサインインとサインアップエクスペリエンスが表示されます。

    サインイン フロー プレビューのスクリーンショット。

1.ユーザー フローを作成する

ユーザー フローを作成するには、要求本文で指定された種類の authentication events flow オブジェクトを作成します。

POST https://graph.microsoft.com/beta/identity/authenticationEventsFlows
{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#identity/authenticationEventsFlows/$entity",
    "@odata.type": "#microsoft.graph.externalUsersSelfServiceSignUpEventsFlow",
    "displayName": "Default sign-up and sign-in",
    "description": "Woodgrove default sign-up and sign-in flow",
    "priority": 500,
    "conditions": {
        "applications": {
            "includeAllApplications": false
        }
    },
    "onInteractiveAuthFlowStart": {
        "@odata.type": "#microsoft.graph.onInteractiveAuthFlowStartExternalUsersSelfServiceSignUp",
        "isSignUpAllowed": true
    },
    "onAuthenticationMethodLoadStart": {
        "@odata.type": "#microsoft.graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp",
        "identityProviders": [
            {
                "@odata.type": "#microsoft.graph.builtInIdentityProvider",
                "id": "EmailPassword-OAUTH"
            }
        ]
    },
    "onAttributeCollection": {
        "@odata.type": "#microsoft.graph.onAttributeCollectionExternalUsersSelfServiceSignUp",
        "accessPackages": [],
        "attributeCollectionPage": {
            "customStringsFileId": null,
            "views": [
                {
                    "title": null,
                    "description": null,
                    "inputs": [
                        {
                            "attribute": "email",
                            "label": "Email Address",
                            "inputType": "text",
                            "defaultValue": null,
                            "hidden": true,
                            "editable": false,
                            "writeToDirectory": true,
                            "required": true,
                            "validationRegEx": "^[a-zA-Z0-9.!#$%&’'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$",
                            "options": []
                        },
                        {
                            "attribute": "displayName",
                            "label": "Display Name",
                            "inputType": "text",
                            "defaultValue": null,
                            "hidden": false,
                            "editable": true,
                            "writeToDirectory": true,
                            "required": true,
                            "validationRegEx": "^.*",
                            "options": []
                        },
                        {
                            "attribute": "country",
                            "label": "Country/Region",
                            "inputType": "radioSingleSelect",
                            "defaultValue": null,
                            "hidden": false,
                            "editable": true,
                            "writeToDirectory": true,
                            "required": false,
                            "validationRegEx": "^.*",
                            "options": [
                                {
                                    "label": "Australia",
                                    "value": "au"
                                },
                                {
                                    "label": "Spain",
                                    "value": "es"
                                },
                                {
                                    "label": "United States",
                                    "value": "us"
                                }
                            ]
                        },
                        {
                            "attribute": "city",
                            "label": "City",
                            "inputType": "text",
                            "defaultValue": null,
                            "hidden": false,
                            "editable": true,
                            "writeToDirectory": true,
                            "required": false,
                            "validationRegEx": "^.*",
                            "options": []
                        }
                    ]
                }
            ]
        },
        "attributes": [
            {
                "id": "email"
            },
            {
                "id": "city"
            },
            {
                "id": "country"
            },
            {
                "id": "displayName"
            }
        ]
    },
    "onUserCreateStart": {
        "@odata.type": "#microsoft.graph.onUserCreateStartExternalUsersSelfServiceSignUp",
        "userTypeToCreate": "member",
        "accessPackages": []
    }
}
1.1 ユーザー フロー ID をコピーする

応答から、ユーザー フロー id の値をコピーします。次に例を示します。

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#identity/authenticationEventsFlows/$entity",
    "@odata.type": "#microsoft.graph.externalUsersSelfServiceSignUpEventsFlow",
    "id": "aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb",
    "displayName": "Default sign-up and sign-in1",
    "description": "Woodgrove default sign-up and sign-in flow",
    ...
}      

2.アプリケーションをユーザー フローに追加する

アプリケーションをユーザー フローに追加またはリンクするには、次の Microsoft Graph 要求を使用します。 {user-flow-ID}ユーザー フロー ID に置き換えます。 {app-ID} を、アプリケーション ID に置き換えます。

POST https://graph.microsoft.com/beta/identity/authenticationEventsFlows/{user-flow-ID}/conditions/applications/includeApplications
{
    "@odata.type": "#microsoft.graph.authenticationConditionApplication",
    "appId": "{app-ID}"
}