サインアップとサインイン ユーザー フローを作成する
演習 - サインアップとサインインのユーザー フローを作成する
ユーザー フローは、ユーザーが従う一連のサインアップ手順と、ユーザーが使用できるサインイン方法 (メールとパスワード、ワンタイム パスコード、Google または Facebook のソーシャル アカウントなど) を定義します。 また、一連の組み込みユーザー属性から選択するか、独自のカスタム属性を追加することで、サインアップ時に顧客から情報を収集することもできます。 顧客に提供する複数のアプリケーションがある場合は、複数のユーザー フローを作成できます。
Note
ユーザー フローを作成するには、少なくとも外部 ID ユーザー フロー管理者ディレクトリ ロールが必要です。
フィードバックがありますか? ご自身の概念実証プロジェクトがどのように進んでいるかをお知らせください。 ご意見をお聞かせください!
サインアップとサインインのユーザー フローを作成するには、Microsoft Entra 管理センターにサインインし、[ID]>[External Identities] に移動します。
メニューから [ユーザー フロー] を選択します。 次に、[新しいユーザー フロー] を選択します。
[作成] ページで、ユーザー フローの [名前] を入力します (例: "SignUpSignIn")。 次に、[ID プロバイダー] で、[Email アカウント] チェック ボックスをオンにし、これらのオプションのいずれかを選択します。 他の ID プロバイダーを構成した場合は、それらを選択できます。
[ユーザー属性] で、サインアップ時にユーザーから収集する属性を選択します。 [もっと表示] を選択して、役職、表示名、郵便番号などの属性の完全な一覧から選択します。 次に、[作成] を選択してユーザー フローを作成します。
一覧から、作成したユーザー フローを選択します。
次の手順では、アプリケーションにアクセスするユーザーのサインアップおよびサインイン エクスペリエンス (ユーザー フロー) をアクティブにします。 左側のメニューで、 [使用] の下の [アプリケーション] を選択します。
[アプリケーションの追加] を選択します。
一覧からアプリケーションを選択します。 または、検索ボックスを使用してアプリケーションを検索し、それを選択します。 [選択] を選択します。
これで、アプリケーションがユーザー フローにリンクされました。 ユーザー フローの実行を選択し、エクスペリエンスをプレビューします。
右側に表示されるユーザー フローの実行ペインで、正しいアプリケーションと応答 URL が選択されていることを確認します。 その後、ユーザー フローの実行を選択します。
お疲れさまでした。 正常にユーザー フローを作成し、アプリケーションをリンクしました!
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}"
}