authenticationEventsFlow を作成する
[アーティクル] 08/17/2024
4 人の共同作成者
フィードバック
この記事の内容
名前空間: microsoft.graph
要求本文で指定された型の新しい authenticationEventsFlow オブジェクトを作成します。 次の派生サブタイプがサポートされています。
この API は、次の国内クラウド展開 で使用できます。
グローバル サービス
米国政府機関 L4
米国政府機関 L5 (DOD)
21Vianet が運営する中国
✅
❌
❌
❌
アクセス許可
この API の最小特権としてマークされているアクセス許可またはアクセス許可を選択します。
アプリで必要な場合にのみ 、より高い特権のアクセス許可またはアクセス許可を使用します。 委任されたアクセス許可とアプリケーションのアクセス許可の詳細については、「アクセス許可の種類 」を参照してください。 これらのアクセス許可の詳細については、「アクセス許可のリファレンス 」を参照してください。
アクセス許可の種類
最小特権アクセス許可
より高い特権のアクセス許可
委任 (職場または学校のアカウント)
EventListener.ReadWrite.All
注意事項なし。
委任 (個人用 Microsoft アカウント)
サポートされていません。
サポートされていません。
アプリケーション
EventListener.ReadWrite.All
注意事項なし。
重要
職場または学校アカウントを使用した委任されたシナリオでは、サインインしているユーザーは、グループの所有者またはメンバーであるか、サポートされているMicrosoft Entraロール またはサポートされているロールのアクセス許可を持つカスタム ロールが割り当てられている必要があります。
外部 IDユーザー フロー管理者 は、この操作でサポートされる最小限の特権ロールです。
HTTP 要求
POST /identity/authenticationEventsFlows
名前
説明
Authorization
ベアラー {token}。 必須です。
認証と認可 についての詳細をご覧ください。
Content-Type
application/json. 必須です。
要求本文
要求本文で、 authenticationEventsFlow オブジェクトの JSON 表現を指定します。
authenticationEventsFlow を作成するときに、次のプロパティを指定できます。
@odata.type プロパティは、本文に特定のユーザー フローの種類の値を含める必要があります。 たとえば、「 "@odata.type": "#microsoft.graph.externalUsersSelfServiceSignupEventsFlow"
」のように入力します。
プロパティ
型
説明
displayName
String
必須です。 イベント ポリシーの表示名。 一意である必要があります。
説明
String
省略可能。 イベント ポリシーの説明。
conditions
authenticationConditions
省略可能。 イベント ポリシーが呼び出されるかどうかを判断するために使用される認証要求のコンテキストを表す条件。
priority
Int32
省略可能。 イベント ポリシーの個々のイベントに使用する優先順位。 1 つのイベントに対して競合する複数のリスナーが同じ優先順位を持つ場合は、1 つが選択され、エラーがサイレント ログに記録されます。 既定値は 500 です。
onInteractiveAuthFlowStart
onInteractiveAuthFlowStartHandler
必須です。 認証フローを開始する準備ができたときに呼び出す内容の構成。
onAuthenticationMethodLoadStart
onAuthenticationMethodLoadStartHandler
必須です。 認証方法をユーザーに提示する準備ができたときに呼び出す内容の構成。 少なくとも 1 つの ID プロバイダーがリンクされている必要があります。
onAttributeCollection
onAttributeCollectionHandler
省略可能。 属性をユーザーから収集する準備ができたときに呼び出す内容の構成。 このプロパティを構成するには、 属性 と onAttributeCollectionPage >views オブジェクトの両方を指定する 必要があります。
onUserCreateStart
onUserCreateStartHandler
省略可能。 ユーザーの作成時に呼び出す内容の構成。
応答
成功した場合、このメソッドは 201 Created
応答コードと、応答本文の authenticationEventsFlow オブジェクトの JSON 表現を返します。 作成された特定のユーザー フローの種類の値を持つ @odata.type プロパティが応答本文に含まれます。 たとえば、「 "@odata.type": "#microsoft.graph.externalUsersSelfServiceSignupEventsFlow"
」のように入力します。
例
例 1: 外部テナントで基本的な外部 ID のサインアップとサインインのユーザー フローを作成する
要求
次の例は要求を示しています。 この例では、次の構成で "Woodgrove ユーザー フロー" という名前のユーザー フローを作成します。
サインアップとサインインを許可します。
ユーザーがパスワード アカウントを使用してローカル メールを作成できるようにします。
ユーザーから 表示名 の組み込み属性を収集します。
収集する属性をユーザーに表示する方法を定義します。
POST https://graph.microsoft.com/v1.0/identity/authenticationEventsFlows
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.externalUsersSelfServiceSignUpEventsFlow",
"displayName": "Woodgrove Drive User Flow",
"onAuthenticationMethodLoadStart": {
"@odata.type": "#microsoft.graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp",
"identityProviders": [
{
"id": "EmailPassword-OAUTH"
}
]
},
"onInteractiveAuthFlowStart": {
"@odata.type": "#microsoft.graph.onInteractiveAuthFlowStartExternalUsersSelfServiceSignUp",
"isSignUpAllowed": true
},
"onAttributeCollection": {
"@odata.type": "#microsoft.graph.onAttributeCollectionExternalUsersSelfServiceSignUp",
"attributes": [
{
"id": "email",
"displayName": "Email Address",
"description": "Email address of the user",
"userFlowAttributeType": "builtIn",
"dataType": "string"
},
{
"id": "displayName",
"displayName": "Display Name",
"description": "Display Name of the User.",
"userFlowAttributeType": "builtIn",
"dataType": "string"
}
],
"attributeCollectionPage": {
"views": [
{
"inputs": [
{
"attribute": "email",
"label": "Email Address",
"inputType": "Text",
"hidden": true,
"editable": false,
"writeToDirectory": true,
"required": true,
"validationRegEx": "^[a-zA-Z0-9.!#$%&’'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)*$"
},
{
"attribute": "displayName",
"label": "Display Name",
"inputType": "text",
"hidden": false,
"editable": true,
"writeToDirectory": true,
"required": false,
"validationRegEx": "^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$"
}
]
}
]
}
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new ExternalUsersSelfServiceSignUpEventsFlow
{
OdataType = "#microsoft.graph.externalUsersSelfServiceSignUpEventsFlow",
DisplayName = "Woodgrove Drive User Flow",
OnAuthenticationMethodLoadStart = new OnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp
{
OdataType = "#microsoft.graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp",
IdentityProviders = new List<IdentityProviderBase>
{
new IdentityProviderBase
{
Id = "EmailPassword-OAUTH",
},
},
},
OnInteractiveAuthFlowStart = new OnInteractiveAuthFlowStartExternalUsersSelfServiceSignUp
{
OdataType = "#microsoft.graph.onInteractiveAuthFlowStartExternalUsersSelfServiceSignUp",
IsSignUpAllowed = true,
},
OnAttributeCollection = new OnAttributeCollectionExternalUsersSelfServiceSignUp
{
OdataType = "#microsoft.graph.onAttributeCollectionExternalUsersSelfServiceSignUp",
Attributes = new List<IdentityUserFlowAttribute>
{
new IdentityUserFlowAttribute
{
Id = "email",
DisplayName = "Email Address",
Description = "Email address of the user",
UserFlowAttributeType = IdentityUserFlowAttributeType.BuiltIn,
DataType = IdentityUserFlowAttributeDataType.String,
},
new IdentityUserFlowAttribute
{
Id = "displayName",
DisplayName = "Display Name",
Description = "Display Name of the User.",
UserFlowAttributeType = IdentityUserFlowAttributeType.BuiltIn,
DataType = IdentityUserFlowAttributeDataType.String,
},
},
AttributeCollectionPage = new AuthenticationAttributeCollectionPage
{
Views = new List<AuthenticationAttributeCollectionPageViewConfiguration>
{
new AuthenticationAttributeCollectionPageViewConfiguration
{
Inputs = new List<AuthenticationAttributeCollectionInputConfiguration>
{
new AuthenticationAttributeCollectionInputConfiguration
{
Attribute = "email",
Label = "Email Address",
InputType = AuthenticationAttributeCollectionInputType.Text,
Hidden = true,
Editable = false,
WriteToDirectory = true,
Required = true,
ValidationRegEx = "^[a-zA-Z0-9.!#$%&’'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)*$",
},
new AuthenticationAttributeCollectionInputConfiguration
{
Attribute = "displayName",
Label = "Display Name",
InputType = AuthenticationAttributeCollectionInputType.Text,
Hidden = false,
Editable = true,
WriteToDirectory = true,
Required = false,
ValidationRegEx = "^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$",
},
},
},
},
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Identity.AuthenticationEventsFlows.PostAsync(requestBody);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
mgc identity authentication-events-flows create --body '{\
"@odata.type": "#microsoft.graph.externalUsersSelfServiceSignUpEventsFlow",\
"displayName": "Woodgrove Drive User Flow",\
"onAuthenticationMethodLoadStart": {\
"@odata.type": "#microsoft.graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp",\
"identityProviders": [\
{\
"id": "EmailPassword-OAUTH"\
}\
]\
}, \
"onInteractiveAuthFlowStart": {\
"@odata.type": "#microsoft.graph.onInteractiveAuthFlowStartExternalUsersSelfServiceSignUp",\
"isSignUpAllowed": true\
},\
"onAttributeCollection": {\
"@odata.type": "#microsoft.graph.onAttributeCollectionExternalUsersSelfServiceSignUp",\
"attributes": [\
{\
"id": "email",\
"displayName": "Email Address",\
"description": "Email address of the user",\
"userFlowAttributeType": "builtIn",\
"dataType": "string"\
},\
{\
"id": "displayName",\
"displayName": "Display Name",\
"description": "Display Name of the User.",\
"userFlowAttributeType": "builtIn",\
"dataType": "string"\
}\
],\
"attributeCollectionPage": {\
"views": [\
{\
"inputs": [\
{\
"attribute": "email",\
"label": "Email Address",\
"inputType": "Text",\
"hidden": true,\
"editable": false,\
"writeToDirectory": true,\
"required": true,\
"validationRegEx": "^[a-zA-Z0-9.!#$%&’'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)*$"\
},\
{\
"attribute": "displayName",\
"label": "Display Name",\
"inputType": "text",\
"hidden": false,\
"editable": true,\
"writeToDirectory": true,\
"required": false,\
"validationRegEx": "^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$"\
}\
]\
}\
]\
}\
}\
}\
'
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewAuthenticationEventsFlow()
displayName := "Woodgrove Drive User Flow"
requestBody.SetDisplayName(&displayName)
onAuthenticationMethodLoadStart := graphmodels.NewOnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp()
identityProviderBase := graphmodels.NewIdentityProviderBase()
id := "EmailPassword-OAUTH"
identityProviderBase.SetId(&id)
identityProviders := []graphmodels.IdentityProviderBaseable {
identityProviderBase,
}
onAuthenticationMethodLoadStart.SetIdentityProviders(identityProviders)
requestBody.SetOnAuthenticationMethodLoadStart(onAuthenticationMethodLoadStart)
onInteractiveAuthFlowStart := graphmodels.NewOnInteractiveAuthFlowStartExternalUsersSelfServiceSignUp()
isSignUpAllowed := true
onInteractiveAuthFlowStart.SetIsSignUpAllowed(&isSignUpAllowed)
requestBody.SetOnInteractiveAuthFlowStart(onInteractiveAuthFlowStart)
onAttributeCollection := graphmodels.NewOnAttributeCollectionExternalUsersSelfServiceSignUp()
identityUserFlowAttribute := graphmodels.NewIdentityUserFlowAttribute()
id := "email"
identityUserFlowAttribute.SetId(&id)
displayName := "Email Address"
identityUserFlowAttribute.SetDisplayName(&displayName)
description := "Email address of the user"
identityUserFlowAttribute.SetDescription(&description)
userFlowAttributeType := graphmodels.BUILTIN_IDENTITYUSERFLOWATTRIBUTETYPE
identityUserFlowAttribute.SetUserFlowAttributeType(&userFlowAttributeType)
dataType := graphmodels.STRING_IDENTITYUSERFLOWATTRIBUTEDATATYPE
identityUserFlowAttribute.SetDataType(&dataType)
identityUserFlowAttribute1 := graphmodels.NewIdentityUserFlowAttribute()
id := "displayName"
identityUserFlowAttribute1.SetId(&id)
displayName := "Display Name"
identityUserFlowAttribute1.SetDisplayName(&displayName)
description := "Display Name of the User."
identityUserFlowAttribute1.SetDescription(&description)
userFlowAttributeType := graphmodels.BUILTIN_IDENTITYUSERFLOWATTRIBUTETYPE
identityUserFlowAttribute1.SetUserFlowAttributeType(&userFlowAttributeType)
dataType := graphmodels.STRING_IDENTITYUSERFLOWATTRIBUTEDATATYPE
identityUserFlowAttribute1.SetDataType(&dataType)
attributes := []graphmodels.IdentityUserFlowAttributeable {
identityUserFlowAttribute,
identityUserFlowAttribute1,
}
onAttributeCollection.SetAttributes(attributes)
attributeCollectionPage := graphmodels.NewAuthenticationAttributeCollectionPage()
authenticationAttributeCollectionPageViewConfiguration := graphmodels.NewAuthenticationAttributeCollectionPageViewConfiguration()
authenticationAttributeCollectionInputConfiguration := graphmodels.NewAuthenticationAttributeCollectionInputConfiguration()
attribute := "email"
authenticationAttributeCollectionInputConfiguration.SetAttribute(&attribute)
label := "Email Address"
authenticationAttributeCollectionInputConfiguration.SetLabel(&label)
inputType := graphmodels.TEXT_AUTHENTICATIONATTRIBUTECOLLECTIONINPUTTYPE
authenticationAttributeCollectionInputConfiguration.SetInputType(&inputType)
hidden := true
authenticationAttributeCollectionInputConfiguration.SetHidden(&hidden)
editable := false
authenticationAttributeCollectionInputConfiguration.SetEditable(&editable)
writeToDirectory := true
authenticationAttributeCollectionInputConfiguration.SetWriteToDirectory(&writeToDirectory)
required := true
authenticationAttributeCollectionInputConfiguration.SetRequired(&required)
validationRegEx := "^[a-zA-Z0-9.!#$%&’'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)*$"
authenticationAttributeCollectionInputConfiguration.SetValidationRegEx(&validationRegEx)
authenticationAttributeCollectionInputConfiguration1 := graphmodels.NewAuthenticationAttributeCollectionInputConfiguration()
attribute := "displayName"
authenticationAttributeCollectionInputConfiguration1.SetAttribute(&attribute)
label := "Display Name"
authenticationAttributeCollectionInputConfiguration1.SetLabel(&label)
inputType := graphmodels.TEXT_AUTHENTICATIONATTRIBUTECOLLECTIONINPUTTYPE
authenticationAttributeCollectionInputConfiguration1.SetInputType(&inputType)
hidden := false
authenticationAttributeCollectionInputConfiguration1.SetHidden(&hidden)
editable := true
authenticationAttributeCollectionInputConfiguration1.SetEditable(&editable)
writeToDirectory := true
authenticationAttributeCollectionInputConfiguration1.SetWriteToDirectory(&writeToDirectory)
required := false
authenticationAttributeCollectionInputConfiguration1.SetRequired(&required)
validationRegEx := "^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$"
authenticationAttributeCollectionInputConfiguration1.SetValidationRegEx(&validationRegEx)
inputs := []graphmodels.AuthenticationAttributeCollectionInputConfigurationable {
authenticationAttributeCollectionInputConfiguration,
authenticationAttributeCollectionInputConfiguration1,
}
authenticationAttributeCollectionPageViewConfiguration.SetInputs(inputs)
views := []graphmodels.AuthenticationAttributeCollectionPageViewConfigurationable {
authenticationAttributeCollectionPageViewConfiguration,
}
attributeCollectionPage.SetViews(views)
onAttributeCollection.SetAttributeCollectionPage(attributeCollectionPage)
requestBody.SetOnAttributeCollection(onAttributeCollection)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
authenticationEventsFlows, err := graphClient.Identity().AuthenticationEventsFlows().Post(context.Background(), requestBody, nil)
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
ExternalUsersSelfServiceSignUpEventsFlow authenticationEventsFlow = new ExternalUsersSelfServiceSignUpEventsFlow();
authenticationEventsFlow.setOdataType("#microsoft.graph.externalUsersSelfServiceSignUpEventsFlow");
authenticationEventsFlow.setDisplayName("Woodgrove Drive User Flow");
OnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp onAuthenticationMethodLoadStart = new OnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp();
onAuthenticationMethodLoadStart.setOdataType("#microsoft.graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp");
LinkedList<IdentityProviderBase> identityProviders = new LinkedList<IdentityProviderBase>();
IdentityProviderBase identityProviderBase = new IdentityProviderBase();
identityProviderBase.setId("EmailPassword-OAUTH");
identityProviders.add(identityProviderBase);
onAuthenticationMethodLoadStart.setIdentityProviders(identityProviders);
authenticationEventsFlow.setOnAuthenticationMethodLoadStart(onAuthenticationMethodLoadStart);
OnInteractiveAuthFlowStartExternalUsersSelfServiceSignUp onInteractiveAuthFlowStart = new OnInteractiveAuthFlowStartExternalUsersSelfServiceSignUp();
onInteractiveAuthFlowStart.setOdataType("#microsoft.graph.onInteractiveAuthFlowStartExternalUsersSelfServiceSignUp");
onInteractiveAuthFlowStart.setIsSignUpAllowed(true);
authenticationEventsFlow.setOnInteractiveAuthFlowStart(onInteractiveAuthFlowStart);
OnAttributeCollectionExternalUsersSelfServiceSignUp onAttributeCollection = new OnAttributeCollectionExternalUsersSelfServiceSignUp();
onAttributeCollection.setOdataType("#microsoft.graph.onAttributeCollectionExternalUsersSelfServiceSignUp");
LinkedList<IdentityUserFlowAttribute> attributes = new LinkedList<IdentityUserFlowAttribute>();
IdentityUserFlowAttribute identityUserFlowAttribute = new IdentityUserFlowAttribute();
identityUserFlowAttribute.setId("email");
identityUserFlowAttribute.setDisplayName("Email Address");
identityUserFlowAttribute.setDescription("Email address of the user");
identityUserFlowAttribute.setUserFlowAttributeType(IdentityUserFlowAttributeType.BuiltIn);
identityUserFlowAttribute.setDataType(IdentityUserFlowAttributeDataType.String);
attributes.add(identityUserFlowAttribute);
IdentityUserFlowAttribute identityUserFlowAttribute1 = new IdentityUserFlowAttribute();
identityUserFlowAttribute1.setId("displayName");
identityUserFlowAttribute1.setDisplayName("Display Name");
identityUserFlowAttribute1.setDescription("Display Name of the User.");
identityUserFlowAttribute1.setUserFlowAttributeType(IdentityUserFlowAttributeType.BuiltIn);
identityUserFlowAttribute1.setDataType(IdentityUserFlowAttributeDataType.String);
attributes.add(identityUserFlowAttribute1);
onAttributeCollection.setAttributes(attributes);
AuthenticationAttributeCollectionPage attributeCollectionPage = new AuthenticationAttributeCollectionPage();
LinkedList<AuthenticationAttributeCollectionPageViewConfiguration> views = new LinkedList<AuthenticationAttributeCollectionPageViewConfiguration>();
AuthenticationAttributeCollectionPageViewConfiguration authenticationAttributeCollectionPageViewConfiguration = new AuthenticationAttributeCollectionPageViewConfiguration();
LinkedList<AuthenticationAttributeCollectionInputConfiguration> inputs = new LinkedList<AuthenticationAttributeCollectionInputConfiguration>();
AuthenticationAttributeCollectionInputConfiguration authenticationAttributeCollectionInputConfiguration = new AuthenticationAttributeCollectionInputConfiguration();
authenticationAttributeCollectionInputConfiguration.setAttribute("email");
authenticationAttributeCollectionInputConfiguration.setLabel("Email Address");
authenticationAttributeCollectionInputConfiguration.setInputType(AuthenticationAttributeCollectionInputType.Text);
authenticationAttributeCollectionInputConfiguration.setHidden(true);
authenticationAttributeCollectionInputConfiguration.setEditable(false);
authenticationAttributeCollectionInputConfiguration.setWriteToDirectory(true);
authenticationAttributeCollectionInputConfiguration.setRequired(true);
authenticationAttributeCollectionInputConfiguration.setValidationRegEx("^[a-zA-Z0-9.!#$%&’'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)*$");
inputs.add(authenticationAttributeCollectionInputConfiguration);
AuthenticationAttributeCollectionInputConfiguration authenticationAttributeCollectionInputConfiguration1 = new AuthenticationAttributeCollectionInputConfiguration();
authenticationAttributeCollectionInputConfiguration1.setAttribute("displayName");
authenticationAttributeCollectionInputConfiguration1.setLabel("Display Name");
authenticationAttributeCollectionInputConfiguration1.setInputType(AuthenticationAttributeCollectionInputType.Text);
authenticationAttributeCollectionInputConfiguration1.setHidden(false);
authenticationAttributeCollectionInputConfiguration1.setEditable(true);
authenticationAttributeCollectionInputConfiguration1.setWriteToDirectory(true);
authenticationAttributeCollectionInputConfiguration1.setRequired(false);
authenticationAttributeCollectionInputConfiguration1.setValidationRegEx("^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$");
inputs.add(authenticationAttributeCollectionInputConfiguration1);
authenticationAttributeCollectionPageViewConfiguration.setInputs(inputs);
views.add(authenticationAttributeCollectionPageViewConfiguration);
attributeCollectionPage.setViews(views);
onAttributeCollection.setAttributeCollectionPage(attributeCollectionPage);
authenticationEventsFlow.setOnAttributeCollection(onAttributeCollection);
AuthenticationEventsFlow result = graphClient.identity().authenticationEventsFlows().post(authenticationEventsFlow);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
const options = {
authProvider,
};
const client = Client.init(options);
const authenticationEventsFlow = {
'@odata.type': '#microsoft.graph.externalUsersSelfServiceSignUpEventsFlow',
displayName: 'Woodgrove Drive User Flow',
onAuthenticationMethodLoadStart: {
'@odata.type': '#microsoft.graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp',
identityProviders: [
{
id: 'EmailPassword-OAUTH'
}
]
},
onInteractiveAuthFlowStart: {
'@odata.type': '#microsoft.graph.onInteractiveAuthFlowStartExternalUsersSelfServiceSignUp',
isSignUpAllowed: true
},
onAttributeCollection: {
'@odata.type': '#microsoft.graph.onAttributeCollectionExternalUsersSelfServiceSignUp',
attributes: [
{
id: 'email',
displayName: 'Email Address',
description: 'Email address of the user',
userFlowAttributeType: 'builtIn',
dataType: 'string'
},
{
id: 'displayName',
displayName: 'Display Name',
description: 'Display Name of the User.',
userFlowAttributeType: 'builtIn',
dataType: 'string'
}
],
attributeCollectionPage: {
views: [
{
inputs: [
{
attribute: 'email',
label: 'Email Address',
inputType: 'Text',
hidden: true,
editable: false,
writeToDirectory: true,
required: true,
validationRegEx: '^[a-zA-Z0-9.!#$%&’\'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)*$'
},
{
attribute: 'displayName',
label: 'Display Name',
inputType: 'text',
hidden: false,
editable: true,
writeToDirectory: true,
required: false,
validationRegEx: '^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$'
}
]
}
]
}
}
};
await client.api('/identity/authenticationEventsFlows')
.post(authenticationEventsFlow);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\ExternalUsersSelfServiceSignUpEventsFlow;
use Microsoft\Graph\Generated\Models\OnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp;
use Microsoft\Graph\Generated\Models\IdentityProviderBase;
use Microsoft\Graph\Generated\Models\OnInteractiveAuthFlowStartExternalUsersSelfServiceSignUp;
use Microsoft\Graph\Generated\Models\OnAttributeCollectionExternalUsersSelfServiceSignUp;
use Microsoft\Graph\Generated\Models\IdentityUserFlowAttribute;
use Microsoft\Graph\Generated\Models\IdentityUserFlowAttributeType;
use Microsoft\Graph\Generated\Models\IdentityUserFlowAttributeDataType;
use Microsoft\Graph\Generated\Models\AuthenticationAttributeCollectionPage;
use Microsoft\Graph\Generated\Models\AuthenticationAttributeCollectionPageViewConfiguration;
use Microsoft\Graph\Generated\Models\AuthenticationAttributeCollectionInputConfiguration;
use Microsoft\Graph\Generated\Models\AuthenticationAttributeCollectionInputType;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new ExternalUsersSelfServiceSignUpEventsFlow();
$requestBody->setOdataType('#microsoft.graph.externalUsersSelfServiceSignUpEventsFlow');
$requestBody->setDisplayName('Woodgrove Drive User Flow');
$onAuthenticationMethodLoadStart = new OnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp();
$onAuthenticationMethodLoadStart->setOdataType('#microsoft.graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp');
$identityProvidersIdentityProviderBase1 = new IdentityProviderBase();
$identityProvidersIdentityProviderBase1->setId('EmailPassword-OAUTH');
$identityProvidersArray []= $identityProvidersIdentityProviderBase1;
$onAuthenticationMethodLoadStart->setIdentityProviders($identityProvidersArray);
$requestBody->setOnAuthenticationMethodLoadStart($onAuthenticationMethodLoadStart);
$onInteractiveAuthFlowStart = new OnInteractiveAuthFlowStartExternalUsersSelfServiceSignUp();
$onInteractiveAuthFlowStart->setOdataType('#microsoft.graph.onInteractiveAuthFlowStartExternalUsersSelfServiceSignUp');
$onInteractiveAuthFlowStart->setIsSignUpAllowed(true);
$requestBody->setOnInteractiveAuthFlowStart($onInteractiveAuthFlowStart);
$onAttributeCollection = new OnAttributeCollectionExternalUsersSelfServiceSignUp();
$onAttributeCollection->setOdataType('#microsoft.graph.onAttributeCollectionExternalUsersSelfServiceSignUp');
$attributesIdentityUserFlowAttribute1 = new IdentityUserFlowAttribute();
$attributesIdentityUserFlowAttribute1->setId('email');
$attributesIdentityUserFlowAttribute1->setDisplayName('Email Address');
$attributesIdentityUserFlowAttribute1->setDescription('Email address of the user');
$attributesIdentityUserFlowAttribute1->setUserFlowAttributeType(new IdentityUserFlowAttributeType('builtIn'));
$attributesIdentityUserFlowAttribute1->setDataType(new IdentityUserFlowAttributeDataType('string'));
$attributesArray []= $attributesIdentityUserFlowAttribute1;
$attributesIdentityUserFlowAttribute2 = new IdentityUserFlowAttribute();
$attributesIdentityUserFlowAttribute2->setId('displayName');
$attributesIdentityUserFlowAttribute2->setDisplayName('Display Name');
$attributesIdentityUserFlowAttribute2->setDescription('Display Name of the User.');
$attributesIdentityUserFlowAttribute2->setUserFlowAttributeType(new IdentityUserFlowAttributeType('builtIn'));
$attributesIdentityUserFlowAttribute2->setDataType(new IdentityUserFlowAttributeDataType('string'));
$attributesArray []= $attributesIdentityUserFlowAttribute2;
$onAttributeCollection->setAttributes($attributesArray);
$onAttributeCollectionAttributeCollectionPage = new AuthenticationAttributeCollectionPage();
$viewsAuthenticationAttributeCollectionPageViewConfiguration1 = new AuthenticationAttributeCollectionPageViewConfiguration();
$inputsAuthenticationAttributeCollectionInputConfiguration1 = new AuthenticationAttributeCollectionInputConfiguration();
$inputsAuthenticationAttributeCollectionInputConfiguration1->setAttribute('email');
$inputsAuthenticationAttributeCollectionInputConfiguration1->setLabel('Email Address');
$inputsAuthenticationAttributeCollectionInputConfiguration1->setInputType(new AuthenticationAttributeCollectionInputType('text'));
$inputsAuthenticationAttributeCollectionInputConfiguration1->setHidden(true);
$inputsAuthenticationAttributeCollectionInputConfiguration1->setEditable(false);
$inputsAuthenticationAttributeCollectionInputConfiguration1->setWriteToDirectory(true);
$inputsAuthenticationAttributeCollectionInputConfiguration1->setRequired(true);
$inputsAuthenticationAttributeCollectionInputConfiguration1->setValidationRegEx('^[a-zA-Z0-9.!#$%&’\'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)*$');
$inputsArray []= $inputsAuthenticationAttributeCollectionInputConfiguration1;
$inputsAuthenticationAttributeCollectionInputConfiguration2 = new AuthenticationAttributeCollectionInputConfiguration();
$inputsAuthenticationAttributeCollectionInputConfiguration2->setAttribute('displayName');
$inputsAuthenticationAttributeCollectionInputConfiguration2->setLabel('Display Name');
$inputsAuthenticationAttributeCollectionInputConfiguration2->setInputType(new AuthenticationAttributeCollectionInputType('text'));
$inputsAuthenticationAttributeCollectionInputConfiguration2->setHidden(false);
$inputsAuthenticationAttributeCollectionInputConfiguration2->setEditable(true);
$inputsAuthenticationAttributeCollectionInputConfiguration2->setWriteToDirectory(true);
$inputsAuthenticationAttributeCollectionInputConfiguration2->setRequired(false);
$inputsAuthenticationAttributeCollectionInputConfiguration2->setValidationRegEx('^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$');
$inputsArray []= $inputsAuthenticationAttributeCollectionInputConfiguration2;
$viewsAuthenticationAttributeCollectionPageViewConfiguration1->setInputs($inputsArray);
$viewsArray []= $viewsAuthenticationAttributeCollectionPageViewConfiguration1;
$onAttributeCollectionAttributeCollectionPage->setViews($viewsArray);
$onAttributeCollection->setAttributeCollectionPage($onAttributeCollectionAttributeCollectionPage);
$requestBody->setOnAttributeCollection($onAttributeCollection);
$result = $graphServiceClient->identity()->authenticationEventsFlows()->post($requestBody)->wait();
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
Import-Module Microsoft.Graph.Identity.SignIns
$params = @{
"@odata.type" = "#microsoft.graph.externalUsersSelfServiceSignUpEventsFlow"
displayName = "Woodgrove Drive User Flow"
onAuthenticationMethodLoadStart = @{
"@odata.type" = "#microsoft.graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp"
identityProviders = @(
@{
id = "EmailPassword-OAUTH"
}
)
}
onInteractiveAuthFlowStart = @{
"@odata.type" = "#microsoft.graph.onInteractiveAuthFlowStartExternalUsersSelfServiceSignUp"
isSignUpAllowed = $true
}
onAttributeCollection = @{
"@odata.type" = "#microsoft.graph.onAttributeCollectionExternalUsersSelfServiceSignUp"
attributes = @(
@{
id = "email"
displayName = "Email Address"
description = "Email address of the user"
userFlowAttributeType = "builtIn"
dataType = "string"
}
@{
id = "displayName"
displayName = "Display Name"
description = "Display Name of the User."
userFlowAttributeType = "builtIn"
dataType = "string"
}
)
attributeCollectionPage = @{
views = @(
@{
inputs = @(
@{
attribute = "email"
label = "Email Address"
inputType = "Text"
hidden = $true
editable = $false
writeToDirectory = $true
required = $true
validationRegEx = "^[a-zA-Z0-9.!#$%&’'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)*$"
}
@{
attribute = "displayName"
label = "Display Name"
inputType = "text"
hidden = $false
editable = $true
writeToDirectory = $true
required = $false
validationRegEx = "^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$"
}
)
}
)
}
}
}
New-MgIdentityAuthenticationEventFlow -BodyParameter $params
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.external_users_self_service_sign_up_events_flow import ExternalUsersSelfServiceSignUpEventsFlow
from msgraph.generated.models.on_authentication_method_load_start_external_users_self_service_sign_up import OnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp
from msgraph.generated.models.identity_provider_base import IdentityProviderBase
from msgraph.generated.models.on_interactive_auth_flow_start_external_users_self_service_sign_up import OnInteractiveAuthFlowStartExternalUsersSelfServiceSignUp
from msgraph.generated.models.on_attribute_collection_external_users_self_service_sign_up import OnAttributeCollectionExternalUsersSelfServiceSignUp
from msgraph.generated.models.identity_user_flow_attribute import IdentityUserFlowAttribute
from msgraph.generated.models.identity_user_flow_attribute_type import IdentityUserFlowAttributeType
from msgraph.generated.models.identity_user_flow_attribute_data_type import IdentityUserFlowAttributeDataType
from msgraph.generated.models.authentication_attribute_collection_page import AuthenticationAttributeCollectionPage
from msgraph.generated.models.authentication_attribute_collection_page_view_configuration import AuthenticationAttributeCollectionPageViewConfiguration
from msgraph.generated.models.authentication_attribute_collection_input_configuration import AuthenticationAttributeCollectionInputConfiguration
from msgraph.generated.models.authentication_attribute_collection_input_type import AuthenticationAttributeCollectionInputType
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = ExternalUsersSelfServiceSignUpEventsFlow(
odata_type = "#microsoft.graph.externalUsersSelfServiceSignUpEventsFlow",
display_name = "Woodgrove Drive User Flow",
on_authentication_method_load_start = OnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp(
odata_type = "#microsoft.graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp",
identity_providers = [
IdentityProviderBase(
id = "EmailPassword-OAUTH",
),
],
),
on_interactive_auth_flow_start = OnInteractiveAuthFlowStartExternalUsersSelfServiceSignUp(
odata_type = "#microsoft.graph.onInteractiveAuthFlowStartExternalUsersSelfServiceSignUp",
is_sign_up_allowed = True,
),
on_attribute_collection = OnAttributeCollectionExternalUsersSelfServiceSignUp(
odata_type = "#microsoft.graph.onAttributeCollectionExternalUsersSelfServiceSignUp",
attributes = [
IdentityUserFlowAttribute(
id = "email",
display_name = "Email Address",
description = "Email address of the user",
user_flow_attribute_type = IdentityUserFlowAttributeType.BuiltIn,
data_type = IdentityUserFlowAttributeDataType.String,
),
IdentityUserFlowAttribute(
id = "displayName",
display_name = "Display Name",
description = "Display Name of the User.",
user_flow_attribute_type = IdentityUserFlowAttributeType.BuiltIn,
data_type = IdentityUserFlowAttributeDataType.String,
),
],
attribute_collection_page = AuthenticationAttributeCollectionPage(
views = [
AuthenticationAttributeCollectionPageViewConfiguration(
inputs = [
AuthenticationAttributeCollectionInputConfiguration(
attribute = "email",
label = "Email Address",
input_type = AuthenticationAttributeCollectionInputType.Text,
hidden = True,
editable = False,
write_to_directory = True,
required = True,
validation_reg_ex = "^[a-zA-Z0-9.!#$%&’'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)*$",
),
AuthenticationAttributeCollectionInputConfiguration(
attribute = "displayName",
label = "Display Name",
input_type = AuthenticationAttributeCollectionInputType.Text,
hidden = False,
editable = True,
write_to_directory = True,
required = False,
validation_reg_ex = "^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$",
),
],
),
],
),
),
)
result = await graph_client.identity.authentication_events_flows.post(request_body)
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
応答
次の例は応答を示しています。
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 201 Created
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#identity/authenticationEventsFlows/$entity",
"@odata.type": "#microsoft.graph.externalUsersSelfServiceSignUpEventsFlow",
"id": "0313cc37-d421-421d-857b-87804d61e33e",
"displayName": "Woodgrove Drive User Flow",
"conditions": {
"applications": {
"includeAllApplications": false
}
},
"onInteractiveAuthFlowStart": {
"@odata.type": "#microsoft.graph.onInteractiveAuthFlowStartExternalUsersSelfServiceSignUp",
"isSignUpAllowed": true
},
"onAuthenticationMethodLoadStart": {
"@odata.type": "#microsoft.graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp"
},
"onAttributeCollection": {
"@odata.type": "#microsoft.graph.onAttributeCollectionExternalUsersSelfServiceSignUp",
"attributeCollectionPage": {
"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": false,
"validationRegEx": "^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$",
"options": []
}
]
}
]
}
}
}
例 2: 外部テナントにアタッチされたアプリケーションを使用して、基本的な外部 ID のサインアップとサインインのユーザー フローを作成する
要求
次の例は要求を示しています。 この例では、次の構成で "Woodgrove ユーザー フロー" という名前のユーザー フローを作成します。
サインアップとサインインを許可します。
ユーザーがパスワード アカウントを使用してローカル メールを作成できるようにします。
ユーザーから 表示名 の組み込み属性を収集します。
収集する属性をユーザーに表示する方法を定義します。
POST https://graph.microsoft.com/v1.0/identity/authenticationEventsFlows
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.externalUsersSelfServiceSignUpEventsFlow",
"displayName": "Woodgrove Drive User Flow",
"conditions": {
"applications": {
"includeApplications": [
{
"appId": "63856651-13d9-4784-9abf-20758d509e19"
}
]
}
},
"onAuthenticationMethodLoadStart": {
"@odata.type": "#microsoft.graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp",
"identityProviders": [
{
"id": "EmailPassword-OAUTH"
}
]
},
"onInteractiveAuthFlowStart": {
"@odata.type": "#microsoft.graph.onInteractiveAuthFlowStartExternalUsersSelfServiceSignUp",
"isSignUpAllowed": true
},
"onAttributeCollection": {
"@odata.type": "#microsoft.graph.onAttributeCollectionExternalUsersSelfServiceSignUp",
"attributes": [
{
"id": "email",
"displayName": "Email Address",
"description": "Email address of the user",
"userFlowAttributeType": "builtIn",
"dataType": "string"
},
{
"id": "displayName",
"displayName": "Display Name",
"description": "Display Name of the User.",
"userFlowAttributeType": "builtIn",
"dataType": "string"
}
],
"attributeCollectionPage": {
"views": [
{
"inputs": [
{
"attribute": "email",
"label": "Email Address",
"inputType": "Text",
"hidden": true,
"editable": false,
"writeToDirectory": true,
"required": true,
"validationRegEx": "^[a-zA-Z0-9.!#$%&’'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)*$"
},
{
"attribute": "displayName",
"label": "Display Name",
"inputType": "text",
"hidden": false,
"editable": true,
"writeToDirectory": true,
"required": false,
"validationRegEx": "^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$"
}
]
}
]
}
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new ExternalUsersSelfServiceSignUpEventsFlow
{
OdataType = "#microsoft.graph.externalUsersSelfServiceSignUpEventsFlow",
DisplayName = "Woodgrove Drive User Flow",
Conditions = new AuthenticationConditions
{
Applications = new AuthenticationConditionsApplications
{
IncludeApplications = new List<AuthenticationConditionApplication>
{
new AuthenticationConditionApplication
{
AppId = "63856651-13d9-4784-9abf-20758d509e19",
},
},
},
},
OnAuthenticationMethodLoadStart = new OnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp
{
OdataType = "#microsoft.graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp",
IdentityProviders = new List<IdentityProviderBase>
{
new IdentityProviderBase
{
Id = "EmailPassword-OAUTH",
},
},
},
OnInteractiveAuthFlowStart = new OnInteractiveAuthFlowStartExternalUsersSelfServiceSignUp
{
OdataType = "#microsoft.graph.onInteractiveAuthFlowStartExternalUsersSelfServiceSignUp",
IsSignUpAllowed = true,
},
OnAttributeCollection = new OnAttributeCollectionExternalUsersSelfServiceSignUp
{
OdataType = "#microsoft.graph.onAttributeCollectionExternalUsersSelfServiceSignUp",
Attributes = new List<IdentityUserFlowAttribute>
{
new IdentityUserFlowAttribute
{
Id = "email",
DisplayName = "Email Address",
Description = "Email address of the user",
UserFlowAttributeType = IdentityUserFlowAttributeType.BuiltIn,
DataType = IdentityUserFlowAttributeDataType.String,
},
new IdentityUserFlowAttribute
{
Id = "displayName",
DisplayName = "Display Name",
Description = "Display Name of the User.",
UserFlowAttributeType = IdentityUserFlowAttributeType.BuiltIn,
DataType = IdentityUserFlowAttributeDataType.String,
},
},
AttributeCollectionPage = new AuthenticationAttributeCollectionPage
{
Views = new List<AuthenticationAttributeCollectionPageViewConfiguration>
{
new AuthenticationAttributeCollectionPageViewConfiguration
{
Inputs = new List<AuthenticationAttributeCollectionInputConfiguration>
{
new AuthenticationAttributeCollectionInputConfiguration
{
Attribute = "email",
Label = "Email Address",
InputType = AuthenticationAttributeCollectionInputType.Text,
Hidden = true,
Editable = false,
WriteToDirectory = true,
Required = true,
ValidationRegEx = "^[a-zA-Z0-9.!#$%&’'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)*$",
},
new AuthenticationAttributeCollectionInputConfiguration
{
Attribute = "displayName",
Label = "Display Name",
InputType = AuthenticationAttributeCollectionInputType.Text,
Hidden = false,
Editable = true,
WriteToDirectory = true,
Required = false,
ValidationRegEx = "^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$",
},
},
},
},
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Identity.AuthenticationEventsFlows.PostAsync(requestBody);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
mgc identity authentication-events-flows create --body '{\
"@odata.type": "#microsoft.graph.externalUsersSelfServiceSignUpEventsFlow",\
"displayName": "Woodgrove Drive User Flow",\
"conditions": {\
"applications": {\
"includeApplications": [\
{\
"appId": "63856651-13d9-4784-9abf-20758d509e19"\
}\
]\
}\
},\
"onAuthenticationMethodLoadStart": {\
"@odata.type": "#microsoft.graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp",\
"identityProviders": [\
{\
"id": "EmailPassword-OAUTH"\
}\
]\
}, \
"onInteractiveAuthFlowStart": {\
"@odata.type": "#microsoft.graph.onInteractiveAuthFlowStartExternalUsersSelfServiceSignUp",\
"isSignUpAllowed": true\
},\
"onAttributeCollection": {\
"@odata.type": "#microsoft.graph.onAttributeCollectionExternalUsersSelfServiceSignUp",\
"attributes": [\
{\
"id": "email",\
"displayName": "Email Address",\
"description": "Email address of the user",\
"userFlowAttributeType": "builtIn",\
"dataType": "string"\
},\
{\
"id": "displayName",\
"displayName": "Display Name",\
"description": "Display Name of the User.",\
"userFlowAttributeType": "builtIn",\
"dataType": "string"\
}\
],\
"attributeCollectionPage": {\
"views": [\
{\
"inputs": [\
{\
"attribute": "email",\
"label": "Email Address",\
"inputType": "Text",\
"hidden": true,\
"editable": false,\
"writeToDirectory": true,\
"required": true,\
"validationRegEx": "^[a-zA-Z0-9.!#$%&’'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)*$"\
},\
{\
"attribute": "displayName",\
"label": "Display Name",\
"inputType": "text",\
"hidden": false,\
"editable": true,\
"writeToDirectory": true,\
"required": false,\
"validationRegEx": "^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$"\
}\
]\
}\
]\
}\
}\
}\
'
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewAuthenticationEventsFlow()
displayName := "Woodgrove Drive User Flow"
requestBody.SetDisplayName(&displayName)
conditions := graphmodels.NewAuthenticationConditions()
applications := graphmodels.NewAuthenticationConditionsApplications()
authenticationConditionApplication := graphmodels.NewAuthenticationConditionApplication()
appId := "63856651-13d9-4784-9abf-20758d509e19"
authenticationConditionApplication.SetAppId(&appId)
includeApplications := []graphmodels.AuthenticationConditionApplicationable {
authenticationConditionApplication,
}
applications.SetIncludeApplications(includeApplications)
conditions.SetApplications(applications)
requestBody.SetConditions(conditions)
onAuthenticationMethodLoadStart := graphmodels.NewOnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp()
identityProviderBase := graphmodels.NewIdentityProviderBase()
id := "EmailPassword-OAUTH"
identityProviderBase.SetId(&id)
identityProviders := []graphmodels.IdentityProviderBaseable {
identityProviderBase,
}
onAuthenticationMethodLoadStart.SetIdentityProviders(identityProviders)
requestBody.SetOnAuthenticationMethodLoadStart(onAuthenticationMethodLoadStart)
onInteractiveAuthFlowStart := graphmodels.NewOnInteractiveAuthFlowStartExternalUsersSelfServiceSignUp()
isSignUpAllowed := true
onInteractiveAuthFlowStart.SetIsSignUpAllowed(&isSignUpAllowed)
requestBody.SetOnInteractiveAuthFlowStart(onInteractiveAuthFlowStart)
onAttributeCollection := graphmodels.NewOnAttributeCollectionExternalUsersSelfServiceSignUp()
identityUserFlowAttribute := graphmodels.NewIdentityUserFlowAttribute()
id := "email"
identityUserFlowAttribute.SetId(&id)
displayName := "Email Address"
identityUserFlowAttribute.SetDisplayName(&displayName)
description := "Email address of the user"
identityUserFlowAttribute.SetDescription(&description)
userFlowAttributeType := graphmodels.BUILTIN_IDENTITYUSERFLOWATTRIBUTETYPE
identityUserFlowAttribute.SetUserFlowAttributeType(&userFlowAttributeType)
dataType := graphmodels.STRING_IDENTITYUSERFLOWATTRIBUTEDATATYPE
identityUserFlowAttribute.SetDataType(&dataType)
identityUserFlowAttribute1 := graphmodels.NewIdentityUserFlowAttribute()
id := "displayName"
identityUserFlowAttribute1.SetId(&id)
displayName := "Display Name"
identityUserFlowAttribute1.SetDisplayName(&displayName)
description := "Display Name of the User."
identityUserFlowAttribute1.SetDescription(&description)
userFlowAttributeType := graphmodels.BUILTIN_IDENTITYUSERFLOWATTRIBUTETYPE
identityUserFlowAttribute1.SetUserFlowAttributeType(&userFlowAttributeType)
dataType := graphmodels.STRING_IDENTITYUSERFLOWATTRIBUTEDATATYPE
identityUserFlowAttribute1.SetDataType(&dataType)
attributes := []graphmodels.IdentityUserFlowAttributeable {
identityUserFlowAttribute,
identityUserFlowAttribute1,
}
onAttributeCollection.SetAttributes(attributes)
attributeCollectionPage := graphmodels.NewAuthenticationAttributeCollectionPage()
authenticationAttributeCollectionPageViewConfiguration := graphmodels.NewAuthenticationAttributeCollectionPageViewConfiguration()
authenticationAttributeCollectionInputConfiguration := graphmodels.NewAuthenticationAttributeCollectionInputConfiguration()
attribute := "email"
authenticationAttributeCollectionInputConfiguration.SetAttribute(&attribute)
label := "Email Address"
authenticationAttributeCollectionInputConfiguration.SetLabel(&label)
inputType := graphmodels.TEXT_AUTHENTICATIONATTRIBUTECOLLECTIONINPUTTYPE
authenticationAttributeCollectionInputConfiguration.SetInputType(&inputType)
hidden := true
authenticationAttributeCollectionInputConfiguration.SetHidden(&hidden)
editable := false
authenticationAttributeCollectionInputConfiguration.SetEditable(&editable)
writeToDirectory := true
authenticationAttributeCollectionInputConfiguration.SetWriteToDirectory(&writeToDirectory)
required := true
authenticationAttributeCollectionInputConfiguration.SetRequired(&required)
validationRegEx := "^[a-zA-Z0-9.!#$%&’'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)*$"
authenticationAttributeCollectionInputConfiguration.SetValidationRegEx(&validationRegEx)
authenticationAttributeCollectionInputConfiguration1 := graphmodels.NewAuthenticationAttributeCollectionInputConfiguration()
attribute := "displayName"
authenticationAttributeCollectionInputConfiguration1.SetAttribute(&attribute)
label := "Display Name"
authenticationAttributeCollectionInputConfiguration1.SetLabel(&label)
inputType := graphmodels.TEXT_AUTHENTICATIONATTRIBUTECOLLECTIONINPUTTYPE
authenticationAttributeCollectionInputConfiguration1.SetInputType(&inputType)
hidden := false
authenticationAttributeCollectionInputConfiguration1.SetHidden(&hidden)
editable := true
authenticationAttributeCollectionInputConfiguration1.SetEditable(&editable)
writeToDirectory := true
authenticationAttributeCollectionInputConfiguration1.SetWriteToDirectory(&writeToDirectory)
required := false
authenticationAttributeCollectionInputConfiguration1.SetRequired(&required)
validationRegEx := "^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$"
authenticationAttributeCollectionInputConfiguration1.SetValidationRegEx(&validationRegEx)
inputs := []graphmodels.AuthenticationAttributeCollectionInputConfigurationable {
authenticationAttributeCollectionInputConfiguration,
authenticationAttributeCollectionInputConfiguration1,
}
authenticationAttributeCollectionPageViewConfiguration.SetInputs(inputs)
views := []graphmodels.AuthenticationAttributeCollectionPageViewConfigurationable {
authenticationAttributeCollectionPageViewConfiguration,
}
attributeCollectionPage.SetViews(views)
onAttributeCollection.SetAttributeCollectionPage(attributeCollectionPage)
requestBody.SetOnAttributeCollection(onAttributeCollection)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
authenticationEventsFlows, err := graphClient.Identity().AuthenticationEventsFlows().Post(context.Background(), requestBody, nil)
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
ExternalUsersSelfServiceSignUpEventsFlow authenticationEventsFlow = new ExternalUsersSelfServiceSignUpEventsFlow();
authenticationEventsFlow.setOdataType("#microsoft.graph.externalUsersSelfServiceSignUpEventsFlow");
authenticationEventsFlow.setDisplayName("Woodgrove Drive User Flow");
AuthenticationConditions conditions = new AuthenticationConditions();
AuthenticationConditionsApplications applications = new AuthenticationConditionsApplications();
LinkedList<AuthenticationConditionApplication> includeApplications = new LinkedList<AuthenticationConditionApplication>();
AuthenticationConditionApplication authenticationConditionApplication = new AuthenticationConditionApplication();
authenticationConditionApplication.setAppId("63856651-13d9-4784-9abf-20758d509e19");
includeApplications.add(authenticationConditionApplication);
applications.setIncludeApplications(includeApplications);
conditions.setApplications(applications);
authenticationEventsFlow.setConditions(conditions);
OnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp onAuthenticationMethodLoadStart = new OnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp();
onAuthenticationMethodLoadStart.setOdataType("#microsoft.graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp");
LinkedList<IdentityProviderBase> identityProviders = new LinkedList<IdentityProviderBase>();
IdentityProviderBase identityProviderBase = new IdentityProviderBase();
identityProviderBase.setId("EmailPassword-OAUTH");
identityProviders.add(identityProviderBase);
onAuthenticationMethodLoadStart.setIdentityProviders(identityProviders);
authenticationEventsFlow.setOnAuthenticationMethodLoadStart(onAuthenticationMethodLoadStart);
OnInteractiveAuthFlowStartExternalUsersSelfServiceSignUp onInteractiveAuthFlowStart = new OnInteractiveAuthFlowStartExternalUsersSelfServiceSignUp();
onInteractiveAuthFlowStart.setOdataType("#microsoft.graph.onInteractiveAuthFlowStartExternalUsersSelfServiceSignUp");
onInteractiveAuthFlowStart.setIsSignUpAllowed(true);
authenticationEventsFlow.setOnInteractiveAuthFlowStart(onInteractiveAuthFlowStart);
OnAttributeCollectionExternalUsersSelfServiceSignUp onAttributeCollection = new OnAttributeCollectionExternalUsersSelfServiceSignUp();
onAttributeCollection.setOdataType("#microsoft.graph.onAttributeCollectionExternalUsersSelfServiceSignUp");
LinkedList<IdentityUserFlowAttribute> attributes = new LinkedList<IdentityUserFlowAttribute>();
IdentityUserFlowAttribute identityUserFlowAttribute = new IdentityUserFlowAttribute();
identityUserFlowAttribute.setId("email");
identityUserFlowAttribute.setDisplayName("Email Address");
identityUserFlowAttribute.setDescription("Email address of the user");
identityUserFlowAttribute.setUserFlowAttributeType(IdentityUserFlowAttributeType.BuiltIn);
identityUserFlowAttribute.setDataType(IdentityUserFlowAttributeDataType.String);
attributes.add(identityUserFlowAttribute);
IdentityUserFlowAttribute identityUserFlowAttribute1 = new IdentityUserFlowAttribute();
identityUserFlowAttribute1.setId("displayName");
identityUserFlowAttribute1.setDisplayName("Display Name");
identityUserFlowAttribute1.setDescription("Display Name of the User.");
identityUserFlowAttribute1.setUserFlowAttributeType(IdentityUserFlowAttributeType.BuiltIn);
identityUserFlowAttribute1.setDataType(IdentityUserFlowAttributeDataType.String);
attributes.add(identityUserFlowAttribute1);
onAttributeCollection.setAttributes(attributes);
AuthenticationAttributeCollectionPage attributeCollectionPage = new AuthenticationAttributeCollectionPage();
LinkedList<AuthenticationAttributeCollectionPageViewConfiguration> views = new LinkedList<AuthenticationAttributeCollectionPageViewConfiguration>();
AuthenticationAttributeCollectionPageViewConfiguration authenticationAttributeCollectionPageViewConfiguration = new AuthenticationAttributeCollectionPageViewConfiguration();
LinkedList<AuthenticationAttributeCollectionInputConfiguration> inputs = new LinkedList<AuthenticationAttributeCollectionInputConfiguration>();
AuthenticationAttributeCollectionInputConfiguration authenticationAttributeCollectionInputConfiguration = new AuthenticationAttributeCollectionInputConfiguration();
authenticationAttributeCollectionInputConfiguration.setAttribute("email");
authenticationAttributeCollectionInputConfiguration.setLabel("Email Address");
authenticationAttributeCollectionInputConfiguration.setInputType(AuthenticationAttributeCollectionInputType.Text);
authenticationAttributeCollectionInputConfiguration.setHidden(true);
authenticationAttributeCollectionInputConfiguration.setEditable(false);
authenticationAttributeCollectionInputConfiguration.setWriteToDirectory(true);
authenticationAttributeCollectionInputConfiguration.setRequired(true);
authenticationAttributeCollectionInputConfiguration.setValidationRegEx("^[a-zA-Z0-9.!#$%&’'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)*$");
inputs.add(authenticationAttributeCollectionInputConfiguration);
AuthenticationAttributeCollectionInputConfiguration authenticationAttributeCollectionInputConfiguration1 = new AuthenticationAttributeCollectionInputConfiguration();
authenticationAttributeCollectionInputConfiguration1.setAttribute("displayName");
authenticationAttributeCollectionInputConfiguration1.setLabel("Display Name");
authenticationAttributeCollectionInputConfiguration1.setInputType(AuthenticationAttributeCollectionInputType.Text);
authenticationAttributeCollectionInputConfiguration1.setHidden(false);
authenticationAttributeCollectionInputConfiguration1.setEditable(true);
authenticationAttributeCollectionInputConfiguration1.setWriteToDirectory(true);
authenticationAttributeCollectionInputConfiguration1.setRequired(false);
authenticationAttributeCollectionInputConfiguration1.setValidationRegEx("^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$");
inputs.add(authenticationAttributeCollectionInputConfiguration1);
authenticationAttributeCollectionPageViewConfiguration.setInputs(inputs);
views.add(authenticationAttributeCollectionPageViewConfiguration);
attributeCollectionPage.setViews(views);
onAttributeCollection.setAttributeCollectionPage(attributeCollectionPage);
authenticationEventsFlow.setOnAttributeCollection(onAttributeCollection);
AuthenticationEventsFlow result = graphClient.identity().authenticationEventsFlows().post(authenticationEventsFlow);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
const options = {
authProvider,
};
const client = Client.init(options);
const authenticationEventsFlow = {
'@odata.type': '#microsoft.graph.externalUsersSelfServiceSignUpEventsFlow',
displayName: 'Woodgrove Drive User Flow',
conditions: {
applications: {
includeApplications: [
{
appId: '63856651-13d9-4784-9abf-20758d509e19'
}
]
}
},
onAuthenticationMethodLoadStart: {
'@odata.type': '#microsoft.graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp',
identityProviders: [
{
id: 'EmailPassword-OAUTH'
}
]
},
onInteractiveAuthFlowStart: {
'@odata.type': '#microsoft.graph.onInteractiveAuthFlowStartExternalUsersSelfServiceSignUp',
isSignUpAllowed: true
},
onAttributeCollection: {
'@odata.type': '#microsoft.graph.onAttributeCollectionExternalUsersSelfServiceSignUp',
attributes: [
{
id: 'email',
displayName: 'Email Address',
description: 'Email address of the user',
userFlowAttributeType: 'builtIn',
dataType: 'string'
},
{
id: 'displayName',
displayName: 'Display Name',
description: 'Display Name of the User.',
userFlowAttributeType: 'builtIn',
dataType: 'string'
}
],
attributeCollectionPage: {
views: [
{
inputs: [
{
attribute: 'email',
label: 'Email Address',
inputType: 'Text',
hidden: true,
editable: false,
writeToDirectory: true,
required: true,
validationRegEx: '^[a-zA-Z0-9.!#$%&’\'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)*$'
},
{
attribute: 'displayName',
label: 'Display Name',
inputType: 'text',
hidden: false,
editable: true,
writeToDirectory: true,
required: false,
validationRegEx: '^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$'
}
]
}
]
}
}
};
await client.api('/identity/authenticationEventsFlows')
.post(authenticationEventsFlow);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\ExternalUsersSelfServiceSignUpEventsFlow;
use Microsoft\Graph\Generated\Models\AuthenticationConditions;
use Microsoft\Graph\Generated\Models\AuthenticationConditionsApplications;
use Microsoft\Graph\Generated\Models\AuthenticationConditionApplication;
use Microsoft\Graph\Generated\Models\OnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp;
use Microsoft\Graph\Generated\Models\IdentityProviderBase;
use Microsoft\Graph\Generated\Models\OnInteractiveAuthFlowStartExternalUsersSelfServiceSignUp;
use Microsoft\Graph\Generated\Models\OnAttributeCollectionExternalUsersSelfServiceSignUp;
use Microsoft\Graph\Generated\Models\IdentityUserFlowAttribute;
use Microsoft\Graph\Generated\Models\IdentityUserFlowAttributeType;
use Microsoft\Graph\Generated\Models\IdentityUserFlowAttributeDataType;
use Microsoft\Graph\Generated\Models\AuthenticationAttributeCollectionPage;
use Microsoft\Graph\Generated\Models\AuthenticationAttributeCollectionPageViewConfiguration;
use Microsoft\Graph\Generated\Models\AuthenticationAttributeCollectionInputConfiguration;
use Microsoft\Graph\Generated\Models\AuthenticationAttributeCollectionInputType;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new ExternalUsersSelfServiceSignUpEventsFlow();
$requestBody->setOdataType('#microsoft.graph.externalUsersSelfServiceSignUpEventsFlow');
$requestBody->setDisplayName('Woodgrove Drive User Flow');
$conditions = new AuthenticationConditions();
$conditionsApplications = new AuthenticationConditionsApplications();
$includeApplicationsAuthenticationConditionApplication1 = new AuthenticationConditionApplication();
$includeApplicationsAuthenticationConditionApplication1->setAppId('63856651-13d9-4784-9abf-20758d509e19');
$includeApplicationsArray []= $includeApplicationsAuthenticationConditionApplication1;
$conditionsApplications->setIncludeApplications($includeApplicationsArray);
$conditions->setApplications($conditionsApplications);
$requestBody->setConditions($conditions);
$onAuthenticationMethodLoadStart = new OnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp();
$onAuthenticationMethodLoadStart->setOdataType('#microsoft.graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp');
$identityProvidersIdentityProviderBase1 = new IdentityProviderBase();
$identityProvidersIdentityProviderBase1->setId('EmailPassword-OAUTH');
$identityProvidersArray []= $identityProvidersIdentityProviderBase1;
$onAuthenticationMethodLoadStart->setIdentityProviders($identityProvidersArray);
$requestBody->setOnAuthenticationMethodLoadStart($onAuthenticationMethodLoadStart);
$onInteractiveAuthFlowStart = new OnInteractiveAuthFlowStartExternalUsersSelfServiceSignUp();
$onInteractiveAuthFlowStart->setOdataType('#microsoft.graph.onInteractiveAuthFlowStartExternalUsersSelfServiceSignUp');
$onInteractiveAuthFlowStart->setIsSignUpAllowed(true);
$requestBody->setOnInteractiveAuthFlowStart($onInteractiveAuthFlowStart);
$onAttributeCollection = new OnAttributeCollectionExternalUsersSelfServiceSignUp();
$onAttributeCollection->setOdataType('#microsoft.graph.onAttributeCollectionExternalUsersSelfServiceSignUp');
$attributesIdentityUserFlowAttribute1 = new IdentityUserFlowAttribute();
$attributesIdentityUserFlowAttribute1->setId('email');
$attributesIdentityUserFlowAttribute1->setDisplayName('Email Address');
$attributesIdentityUserFlowAttribute1->setDescription('Email address of the user');
$attributesIdentityUserFlowAttribute1->setUserFlowAttributeType(new IdentityUserFlowAttributeType('builtIn'));
$attributesIdentityUserFlowAttribute1->setDataType(new IdentityUserFlowAttributeDataType('string'));
$attributesArray []= $attributesIdentityUserFlowAttribute1;
$attributesIdentityUserFlowAttribute2 = new IdentityUserFlowAttribute();
$attributesIdentityUserFlowAttribute2->setId('displayName');
$attributesIdentityUserFlowAttribute2->setDisplayName('Display Name');
$attributesIdentityUserFlowAttribute2->setDescription('Display Name of the User.');
$attributesIdentityUserFlowAttribute2->setUserFlowAttributeType(new IdentityUserFlowAttributeType('builtIn'));
$attributesIdentityUserFlowAttribute2->setDataType(new IdentityUserFlowAttributeDataType('string'));
$attributesArray []= $attributesIdentityUserFlowAttribute2;
$onAttributeCollection->setAttributes($attributesArray);
$onAttributeCollectionAttributeCollectionPage = new AuthenticationAttributeCollectionPage();
$viewsAuthenticationAttributeCollectionPageViewConfiguration1 = new AuthenticationAttributeCollectionPageViewConfiguration();
$inputsAuthenticationAttributeCollectionInputConfiguration1 = new AuthenticationAttributeCollectionInputConfiguration();
$inputsAuthenticationAttributeCollectionInputConfiguration1->setAttribute('email');
$inputsAuthenticationAttributeCollectionInputConfiguration1->setLabel('Email Address');
$inputsAuthenticationAttributeCollectionInputConfiguration1->setInputType(new AuthenticationAttributeCollectionInputType('text'));
$inputsAuthenticationAttributeCollectionInputConfiguration1->setHidden(true);
$inputsAuthenticationAttributeCollectionInputConfiguration1->setEditable(false);
$inputsAuthenticationAttributeCollectionInputConfiguration1->setWriteToDirectory(true);
$inputsAuthenticationAttributeCollectionInputConfiguration1->setRequired(true);
$inputsAuthenticationAttributeCollectionInputConfiguration1->setValidationRegEx('^[a-zA-Z0-9.!#$%&’\'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)*$');
$inputsArray []= $inputsAuthenticationAttributeCollectionInputConfiguration1;
$inputsAuthenticationAttributeCollectionInputConfiguration2 = new AuthenticationAttributeCollectionInputConfiguration();
$inputsAuthenticationAttributeCollectionInputConfiguration2->setAttribute('displayName');
$inputsAuthenticationAttributeCollectionInputConfiguration2->setLabel('Display Name');
$inputsAuthenticationAttributeCollectionInputConfiguration2->setInputType(new AuthenticationAttributeCollectionInputType('text'));
$inputsAuthenticationAttributeCollectionInputConfiguration2->setHidden(false);
$inputsAuthenticationAttributeCollectionInputConfiguration2->setEditable(true);
$inputsAuthenticationAttributeCollectionInputConfiguration2->setWriteToDirectory(true);
$inputsAuthenticationAttributeCollectionInputConfiguration2->setRequired(false);
$inputsAuthenticationAttributeCollectionInputConfiguration2->setValidationRegEx('^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$');
$inputsArray []= $inputsAuthenticationAttributeCollectionInputConfiguration2;
$viewsAuthenticationAttributeCollectionPageViewConfiguration1->setInputs($inputsArray);
$viewsArray []= $viewsAuthenticationAttributeCollectionPageViewConfiguration1;
$onAttributeCollectionAttributeCollectionPage->setViews($viewsArray);
$onAttributeCollection->setAttributeCollectionPage($onAttributeCollectionAttributeCollectionPage);
$requestBody->setOnAttributeCollection($onAttributeCollection);
$result = $graphServiceClient->identity()->authenticationEventsFlows()->post($requestBody)->wait();
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
Import-Module Microsoft.Graph.Identity.SignIns
$params = @{
"@odata.type" = "#microsoft.graph.externalUsersSelfServiceSignUpEventsFlow"
displayName = "Woodgrove Drive User Flow"
conditions = @{
applications = @{
includeApplications = @(
@{
appId = "63856651-13d9-4784-9abf-20758d509e19"
}
)
}
}
onAuthenticationMethodLoadStart = @{
"@odata.type" = "#microsoft.graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp"
identityProviders = @(
@{
id = "EmailPassword-OAUTH"
}
)
}
onInteractiveAuthFlowStart = @{
"@odata.type" = "#microsoft.graph.onInteractiveAuthFlowStartExternalUsersSelfServiceSignUp"
isSignUpAllowed = $true
}
onAttributeCollection = @{
"@odata.type" = "#microsoft.graph.onAttributeCollectionExternalUsersSelfServiceSignUp"
attributes = @(
@{
id = "email"
displayName = "Email Address"
description = "Email address of the user"
userFlowAttributeType = "builtIn"
dataType = "string"
}
@{
id = "displayName"
displayName = "Display Name"
description = "Display Name of the User."
userFlowAttributeType = "builtIn"
dataType = "string"
}
)
attributeCollectionPage = @{
views = @(
@{
inputs = @(
@{
attribute = "email"
label = "Email Address"
inputType = "Text"
hidden = $true
editable = $false
writeToDirectory = $true
required = $true
validationRegEx = "^[a-zA-Z0-9.!#$%&’'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)*$"
}
@{
attribute = "displayName"
label = "Display Name"
inputType = "text"
hidden = $false
editable = $true
writeToDirectory = $true
required = $false
validationRegEx = "^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$"
}
)
}
)
}
}
}
New-MgIdentityAuthenticationEventFlow -BodyParameter $params
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.external_users_self_service_sign_up_events_flow import ExternalUsersSelfServiceSignUpEventsFlow
from msgraph.generated.models.authentication_conditions import AuthenticationConditions
from msgraph.generated.models.authentication_conditions_applications import AuthenticationConditionsApplications
from msgraph.generated.models.authentication_condition_application import AuthenticationConditionApplication
from msgraph.generated.models.on_authentication_method_load_start_external_users_self_service_sign_up import OnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp
from msgraph.generated.models.identity_provider_base import IdentityProviderBase
from msgraph.generated.models.on_interactive_auth_flow_start_external_users_self_service_sign_up import OnInteractiveAuthFlowStartExternalUsersSelfServiceSignUp
from msgraph.generated.models.on_attribute_collection_external_users_self_service_sign_up import OnAttributeCollectionExternalUsersSelfServiceSignUp
from msgraph.generated.models.identity_user_flow_attribute import IdentityUserFlowAttribute
from msgraph.generated.models.identity_user_flow_attribute_type import IdentityUserFlowAttributeType
from msgraph.generated.models.identity_user_flow_attribute_data_type import IdentityUserFlowAttributeDataType
from msgraph.generated.models.authentication_attribute_collection_page import AuthenticationAttributeCollectionPage
from msgraph.generated.models.authentication_attribute_collection_page_view_configuration import AuthenticationAttributeCollectionPageViewConfiguration
from msgraph.generated.models.authentication_attribute_collection_input_configuration import AuthenticationAttributeCollectionInputConfiguration
from msgraph.generated.models.authentication_attribute_collection_input_type import AuthenticationAttributeCollectionInputType
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = ExternalUsersSelfServiceSignUpEventsFlow(
odata_type = "#microsoft.graph.externalUsersSelfServiceSignUpEventsFlow",
display_name = "Woodgrove Drive User Flow",
conditions = AuthenticationConditions(
applications = AuthenticationConditionsApplications(
include_applications = [
AuthenticationConditionApplication(
app_id = "63856651-13d9-4784-9abf-20758d509e19",
),
],
),
),
on_authentication_method_load_start = OnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp(
odata_type = "#microsoft.graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp",
identity_providers = [
IdentityProviderBase(
id = "EmailPassword-OAUTH",
),
],
),
on_interactive_auth_flow_start = OnInteractiveAuthFlowStartExternalUsersSelfServiceSignUp(
odata_type = "#microsoft.graph.onInteractiveAuthFlowStartExternalUsersSelfServiceSignUp",
is_sign_up_allowed = True,
),
on_attribute_collection = OnAttributeCollectionExternalUsersSelfServiceSignUp(
odata_type = "#microsoft.graph.onAttributeCollectionExternalUsersSelfServiceSignUp",
attributes = [
IdentityUserFlowAttribute(
id = "email",
display_name = "Email Address",
description = "Email address of the user",
user_flow_attribute_type = IdentityUserFlowAttributeType.BuiltIn,
data_type = IdentityUserFlowAttributeDataType.String,
),
IdentityUserFlowAttribute(
id = "displayName",
display_name = "Display Name",
description = "Display Name of the User.",
user_flow_attribute_type = IdentityUserFlowAttributeType.BuiltIn,
data_type = IdentityUserFlowAttributeDataType.String,
),
],
attribute_collection_page = AuthenticationAttributeCollectionPage(
views = [
AuthenticationAttributeCollectionPageViewConfiguration(
inputs = [
AuthenticationAttributeCollectionInputConfiguration(
attribute = "email",
label = "Email Address",
input_type = AuthenticationAttributeCollectionInputType.Text,
hidden = True,
editable = False,
write_to_directory = True,
required = True,
validation_reg_ex = "^[a-zA-Z0-9.!#$%&’'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)*$",
),
AuthenticationAttributeCollectionInputConfiguration(
attribute = "displayName",
label = "Display Name",
input_type = AuthenticationAttributeCollectionInputType.Text,
hidden = False,
editable = True,
write_to_directory = True,
required = False,
validation_reg_ex = "^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$",
),
],
),
],
),
),
)
result = await graph_client.identity.authentication_events_flows.post(request_body)
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
応答
次の例は応答を示しています。
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 201 Created
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#identity/authenticationEventsFlows/$entity",
"@odata.type": "#microsoft.graph.externalUsersSelfServiceSignUpEventsFlow",
"id": "1d51b447-eb52-4ec8-ae4e-0a35ebc148ea",
"displayName": "Woodgrove Drive User Flow",
"description": null,
"onUserCreateStart": null,
"conditions": {
"applications": {
"includeAllApplications": false
}
},
"onInteractiveAuthFlowStart": {
"@odata.type": "#microsoft.graph.onInteractiveAuthFlowStartExternalUsersSelfServiceSignUp",
"isSignUpAllowed": true
},
"onAuthenticationMethodLoadStart": {
"@odata.type": "#microsoft.graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp"
},
"onAttributeCollection": {
"@odata.type": "#microsoft.graph.onAttributeCollectionExternalUsersSelfServiceSignUp",
"attributeCollectionPage": {
"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": false,
"validationRegEx": "^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$",
"options": []
}
]
}
]
}
}
}
例 3: ソーシャル プロバイダーとカスタム属性を使用して外部 ID のサインアップとサインインのユーザー フローを作成する
要求
次の例は要求を示しています。 この例では、次の構成で "Woodgrove Drive User Flow" という名前のユーザー フローを作成します
サインアップとサインインを許可します。
ユーザーがパスワード アカウントを使用してローカル メールを作成できるようにするか、Google または Facebookで認証できるようにする
[表示名 ] 組み込み属性と [お気に入りの色] カスタム属性を収集します。
POST https://graph.microsoft.com/v1.0/identity/authenticationEventsFlows
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.externalUsersSelfServiceSignUpEventsFlow",
"displayName": "Woodgrove User Flow 2",
"onAuthenticationMethodLoadStart": {
"@odata.type": "#microsoft.graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp",
"identityProviders": [
{
"id": "EmailPassword-OAUTH"
},
{
"id": "Google-OAUTH"
},
{
"id": "Facebook-OAUTH"
}
]
},
"onInteractiveAuthFlowStart": {
"@odata.type": "#microsoft.graph.onInteractiveAuthFlowStartExternalUsersSelfServiceSignUp",
"isSignUpAllowed": true
},
"onAttributeCollection": {
"@odata.type": "#microsoft.graph.onAttributeCollectionExternalUsersSelfServiceSignUp",
"attributes": [
{
"id": "email",
"displayName": "Email Address",
"description": "Email address of the user",
"userFlowAttributeType": "builtIn",
"dataType": "string"
},
{
"id": "displayName",
"displayName": "Display Name",
"description": "Display Name of the User.",
"userFlowAttributeType": "builtIn",
"dataType": "string"
},
{
"id": "extension_6ea3bc85aec24b1c92ff4a117afb6621_Favoritecolor",
"displayName": "Favorite color",
"description": "what is your favorite color",
"userFlowAttributeType": "custom",
"dataType": "string"
}
],
"attributeCollectionPage": {
"views": [
{
"inputs": [
{
"attribute": "email",
"label": "Email Address",
"inputType": "Text",
"hidden": true,
"editable": false,
"writeToDirectory": true,
"required": true,
"validationRegEx": "^[a-zA-Z0-9.!#$%&’'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)*$"
},
{
"attribute": "displayName",
"label": "Display Name",
"inputType": "text",
"hidden": false,
"editable": true,
"writeToDirectory": true,
"required": false,
"validationRegEx": "^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$"
},
{
"attribute": "extension_6ea3bc85aec24b1c92ff4a117afb6621_Favoritecolor",
"label": "Favorite color",
"inputType": "text",
"hidden": false,
"editable": true,
"writeToDirectory": true,
"required": false,
"validationRegEx": "^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$"
}
]
}
]
}
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new ExternalUsersSelfServiceSignUpEventsFlow
{
OdataType = "#microsoft.graph.externalUsersSelfServiceSignUpEventsFlow",
DisplayName = "Woodgrove User Flow 2",
OnAuthenticationMethodLoadStart = new OnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp
{
OdataType = "#microsoft.graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp",
IdentityProviders = new List<IdentityProviderBase>
{
new IdentityProviderBase
{
Id = "EmailPassword-OAUTH",
},
new IdentityProviderBase
{
Id = "Google-OAUTH",
},
new IdentityProviderBase
{
Id = "Facebook-OAUTH",
},
},
},
OnInteractiveAuthFlowStart = new OnInteractiveAuthFlowStartExternalUsersSelfServiceSignUp
{
OdataType = "#microsoft.graph.onInteractiveAuthFlowStartExternalUsersSelfServiceSignUp",
IsSignUpAllowed = true,
},
OnAttributeCollection = new OnAttributeCollectionExternalUsersSelfServiceSignUp
{
OdataType = "#microsoft.graph.onAttributeCollectionExternalUsersSelfServiceSignUp",
Attributes = new List<IdentityUserFlowAttribute>
{
new IdentityUserFlowAttribute
{
Id = "email",
DisplayName = "Email Address",
Description = "Email address of the user",
UserFlowAttributeType = IdentityUserFlowAttributeType.BuiltIn,
DataType = IdentityUserFlowAttributeDataType.String,
},
new IdentityUserFlowAttribute
{
Id = "displayName",
DisplayName = "Display Name",
Description = "Display Name of the User.",
UserFlowAttributeType = IdentityUserFlowAttributeType.BuiltIn,
DataType = IdentityUserFlowAttributeDataType.String,
},
new IdentityUserFlowAttribute
{
Id = "extension_6ea3bc85aec24b1c92ff4a117afb6621_Favoritecolor",
DisplayName = "Favorite color",
Description = "what is your favorite color",
UserFlowAttributeType = IdentityUserFlowAttributeType.Custom,
DataType = IdentityUserFlowAttributeDataType.String,
},
},
AttributeCollectionPage = new AuthenticationAttributeCollectionPage
{
Views = new List<AuthenticationAttributeCollectionPageViewConfiguration>
{
new AuthenticationAttributeCollectionPageViewConfiguration
{
Inputs = new List<AuthenticationAttributeCollectionInputConfiguration>
{
new AuthenticationAttributeCollectionInputConfiguration
{
Attribute = "email",
Label = "Email Address",
InputType = AuthenticationAttributeCollectionInputType.Text,
Hidden = true,
Editable = false,
WriteToDirectory = true,
Required = true,
ValidationRegEx = "^[a-zA-Z0-9.!#$%&’'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)*$",
},
new AuthenticationAttributeCollectionInputConfiguration
{
Attribute = "displayName",
Label = "Display Name",
InputType = AuthenticationAttributeCollectionInputType.Text,
Hidden = false,
Editable = true,
WriteToDirectory = true,
Required = false,
ValidationRegEx = "^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$",
},
new AuthenticationAttributeCollectionInputConfiguration
{
Attribute = "extension_6ea3bc85aec24b1c92ff4a117afb6621_Favoritecolor",
Label = "Favorite color",
InputType = AuthenticationAttributeCollectionInputType.Text,
Hidden = false,
Editable = true,
WriteToDirectory = true,
Required = false,
ValidationRegEx = "^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$",
},
},
},
},
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Identity.AuthenticationEventsFlows.PostAsync(requestBody);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
mgc identity authentication-events-flows create --body '{\
"@odata.type": "#microsoft.graph.externalUsersSelfServiceSignUpEventsFlow",\
"displayName": "Woodgrove User Flow 2",\
"onAuthenticationMethodLoadStart": {\
"@odata.type": "#microsoft.graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp",\
"identityProviders": [\
{\
"id": "EmailPassword-OAUTH"\
},\
{\
"id": "Google-OAUTH"\
},\
{\
"id": "Facebook-OAUTH"\
}\
]\
}, \
"onInteractiveAuthFlowStart": {\
"@odata.type": "#microsoft.graph.onInteractiveAuthFlowStartExternalUsersSelfServiceSignUp",\
"isSignUpAllowed": true\
},\
"onAttributeCollection": {\
"@odata.type": "#microsoft.graph.onAttributeCollectionExternalUsersSelfServiceSignUp",\
"attributes": [\
{\
"id": "email",\
"displayName": "Email Address",\
"description": "Email address of the user",\
"userFlowAttributeType": "builtIn",\
"dataType": "string"\
},\
{\
"id": "displayName",\
"displayName": "Display Name",\
"description": "Display Name of the User.",\
"userFlowAttributeType": "builtIn",\
"dataType": "string"\
},\
{\
"id": "extension_6ea3bc85aec24b1c92ff4a117afb6621_Favoritecolor",\
"displayName": "Favorite color",\
"description": "what is your favorite color",\
"userFlowAttributeType": "custom",\
"dataType": "string"\
}\
],\
"attributeCollectionPage": {\
"views": [\
{\
"inputs": [\
{\
"attribute": "email",\
"label": "Email Address",\
"inputType": "Text",\
"hidden": true,\
"editable": false,\
"writeToDirectory": true,\
"required": true,\
"validationRegEx": "^[a-zA-Z0-9.!#$%&’'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)*$"\
},\
{\
"attribute": "displayName",\
"label": "Display Name",\
"inputType": "text",\
"hidden": false,\
"editable": true,\
"writeToDirectory": true,\
"required": false,\
"validationRegEx": "^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$"\
},\
{\
"attribute": "extension_6ea3bc85aec24b1c92ff4a117afb6621_Favoritecolor",\
"label": "Favorite color",\
"inputType": "text",\
"hidden": false,\
"editable": true,\
"writeToDirectory": true,\
"required": false,\
"validationRegEx": "^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$"\
}\
]\
}\
]\
}\
}\
}\
'
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewAuthenticationEventsFlow()
displayName := "Woodgrove User Flow 2"
requestBody.SetDisplayName(&displayName)
onAuthenticationMethodLoadStart := graphmodels.NewOnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp()
identityProviderBase := graphmodels.NewIdentityProviderBase()
id := "EmailPassword-OAUTH"
identityProviderBase.SetId(&id)
identityProviderBase1 := graphmodels.NewIdentityProviderBase()
id := "Google-OAUTH"
identityProviderBase1.SetId(&id)
identityProviderBase2 := graphmodels.NewIdentityProviderBase()
id := "Facebook-OAUTH"
identityProviderBase2.SetId(&id)
identityProviders := []graphmodels.IdentityProviderBaseable {
identityProviderBase,
identityProviderBase1,
identityProviderBase2,
}
onAuthenticationMethodLoadStart.SetIdentityProviders(identityProviders)
requestBody.SetOnAuthenticationMethodLoadStart(onAuthenticationMethodLoadStart)
onInteractiveAuthFlowStart := graphmodels.NewOnInteractiveAuthFlowStartExternalUsersSelfServiceSignUp()
isSignUpAllowed := true
onInteractiveAuthFlowStart.SetIsSignUpAllowed(&isSignUpAllowed)
requestBody.SetOnInteractiveAuthFlowStart(onInteractiveAuthFlowStart)
onAttributeCollection := graphmodels.NewOnAttributeCollectionExternalUsersSelfServiceSignUp()
identityUserFlowAttribute := graphmodels.NewIdentityUserFlowAttribute()
id := "email"
identityUserFlowAttribute.SetId(&id)
displayName := "Email Address"
identityUserFlowAttribute.SetDisplayName(&displayName)
description := "Email address of the user"
identityUserFlowAttribute.SetDescription(&description)
userFlowAttributeType := graphmodels.BUILTIN_IDENTITYUSERFLOWATTRIBUTETYPE
identityUserFlowAttribute.SetUserFlowAttributeType(&userFlowAttributeType)
dataType := graphmodels.STRING_IDENTITYUSERFLOWATTRIBUTEDATATYPE
identityUserFlowAttribute.SetDataType(&dataType)
identityUserFlowAttribute1 := graphmodels.NewIdentityUserFlowAttribute()
id := "displayName"
identityUserFlowAttribute1.SetId(&id)
displayName := "Display Name"
identityUserFlowAttribute1.SetDisplayName(&displayName)
description := "Display Name of the User."
identityUserFlowAttribute1.SetDescription(&description)
userFlowAttributeType := graphmodels.BUILTIN_IDENTITYUSERFLOWATTRIBUTETYPE
identityUserFlowAttribute1.SetUserFlowAttributeType(&userFlowAttributeType)
dataType := graphmodels.STRING_IDENTITYUSERFLOWATTRIBUTEDATATYPE
identityUserFlowAttribute1.SetDataType(&dataType)
identityUserFlowAttribute2 := graphmodels.NewIdentityUserFlowAttribute()
id := "extension_6ea3bc85aec24b1c92ff4a117afb6621_Favoritecolor"
identityUserFlowAttribute2.SetId(&id)
displayName := "Favorite color"
identityUserFlowAttribute2.SetDisplayName(&displayName)
description := "what is your favorite color"
identityUserFlowAttribute2.SetDescription(&description)
userFlowAttributeType := graphmodels.CUSTOM_IDENTITYUSERFLOWATTRIBUTETYPE
identityUserFlowAttribute2.SetUserFlowAttributeType(&userFlowAttributeType)
dataType := graphmodels.STRING_IDENTITYUSERFLOWATTRIBUTEDATATYPE
identityUserFlowAttribute2.SetDataType(&dataType)
attributes := []graphmodels.IdentityUserFlowAttributeable {
identityUserFlowAttribute,
identityUserFlowAttribute1,
identityUserFlowAttribute2,
}
onAttributeCollection.SetAttributes(attributes)
attributeCollectionPage := graphmodels.NewAuthenticationAttributeCollectionPage()
authenticationAttributeCollectionPageViewConfiguration := graphmodels.NewAuthenticationAttributeCollectionPageViewConfiguration()
authenticationAttributeCollectionInputConfiguration := graphmodels.NewAuthenticationAttributeCollectionInputConfiguration()
attribute := "email"
authenticationAttributeCollectionInputConfiguration.SetAttribute(&attribute)
label := "Email Address"
authenticationAttributeCollectionInputConfiguration.SetLabel(&label)
inputType := graphmodels.TEXT_AUTHENTICATIONATTRIBUTECOLLECTIONINPUTTYPE
authenticationAttributeCollectionInputConfiguration.SetInputType(&inputType)
hidden := true
authenticationAttributeCollectionInputConfiguration.SetHidden(&hidden)
editable := false
authenticationAttributeCollectionInputConfiguration.SetEditable(&editable)
writeToDirectory := true
authenticationAttributeCollectionInputConfiguration.SetWriteToDirectory(&writeToDirectory)
required := true
authenticationAttributeCollectionInputConfiguration.SetRequired(&required)
validationRegEx := "^[a-zA-Z0-9.!#$%&’'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)*$"
authenticationAttributeCollectionInputConfiguration.SetValidationRegEx(&validationRegEx)
authenticationAttributeCollectionInputConfiguration1 := graphmodels.NewAuthenticationAttributeCollectionInputConfiguration()
attribute := "displayName"
authenticationAttributeCollectionInputConfiguration1.SetAttribute(&attribute)
label := "Display Name"
authenticationAttributeCollectionInputConfiguration1.SetLabel(&label)
inputType := graphmodels.TEXT_AUTHENTICATIONATTRIBUTECOLLECTIONINPUTTYPE
authenticationAttributeCollectionInputConfiguration1.SetInputType(&inputType)
hidden := false
authenticationAttributeCollectionInputConfiguration1.SetHidden(&hidden)
editable := true
authenticationAttributeCollectionInputConfiguration1.SetEditable(&editable)
writeToDirectory := true
authenticationAttributeCollectionInputConfiguration1.SetWriteToDirectory(&writeToDirectory)
required := false
authenticationAttributeCollectionInputConfiguration1.SetRequired(&required)
validationRegEx := "^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$"
authenticationAttributeCollectionInputConfiguration1.SetValidationRegEx(&validationRegEx)
authenticationAttributeCollectionInputConfiguration2 := graphmodels.NewAuthenticationAttributeCollectionInputConfiguration()
attribute := "extension_6ea3bc85aec24b1c92ff4a117afb6621_Favoritecolor"
authenticationAttributeCollectionInputConfiguration2.SetAttribute(&attribute)
label := "Favorite color"
authenticationAttributeCollectionInputConfiguration2.SetLabel(&label)
inputType := graphmodels.TEXT_AUTHENTICATIONATTRIBUTECOLLECTIONINPUTTYPE
authenticationAttributeCollectionInputConfiguration2.SetInputType(&inputType)
hidden := false
authenticationAttributeCollectionInputConfiguration2.SetHidden(&hidden)
editable := true
authenticationAttributeCollectionInputConfiguration2.SetEditable(&editable)
writeToDirectory := true
authenticationAttributeCollectionInputConfiguration2.SetWriteToDirectory(&writeToDirectory)
required := false
authenticationAttributeCollectionInputConfiguration2.SetRequired(&required)
validationRegEx := "^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$"
authenticationAttributeCollectionInputConfiguration2.SetValidationRegEx(&validationRegEx)
inputs := []graphmodels.AuthenticationAttributeCollectionInputConfigurationable {
authenticationAttributeCollectionInputConfiguration,
authenticationAttributeCollectionInputConfiguration1,
authenticationAttributeCollectionInputConfiguration2,
}
authenticationAttributeCollectionPageViewConfiguration.SetInputs(inputs)
views := []graphmodels.AuthenticationAttributeCollectionPageViewConfigurationable {
authenticationAttributeCollectionPageViewConfiguration,
}
attributeCollectionPage.SetViews(views)
onAttributeCollection.SetAttributeCollectionPage(attributeCollectionPage)
requestBody.SetOnAttributeCollection(onAttributeCollection)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
authenticationEventsFlows, err := graphClient.Identity().AuthenticationEventsFlows().Post(context.Background(), requestBody, nil)
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
ExternalUsersSelfServiceSignUpEventsFlow authenticationEventsFlow = new ExternalUsersSelfServiceSignUpEventsFlow();
authenticationEventsFlow.setOdataType("#microsoft.graph.externalUsersSelfServiceSignUpEventsFlow");
authenticationEventsFlow.setDisplayName("Woodgrove User Flow 2");
OnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp onAuthenticationMethodLoadStart = new OnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp();
onAuthenticationMethodLoadStart.setOdataType("#microsoft.graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp");
LinkedList<IdentityProviderBase> identityProviders = new LinkedList<IdentityProviderBase>();
IdentityProviderBase identityProviderBase = new IdentityProviderBase();
identityProviderBase.setId("EmailPassword-OAUTH");
identityProviders.add(identityProviderBase);
IdentityProviderBase identityProviderBase1 = new IdentityProviderBase();
identityProviderBase1.setId("Google-OAUTH");
identityProviders.add(identityProviderBase1);
IdentityProviderBase identityProviderBase2 = new IdentityProviderBase();
identityProviderBase2.setId("Facebook-OAUTH");
identityProviders.add(identityProviderBase2);
onAuthenticationMethodLoadStart.setIdentityProviders(identityProviders);
authenticationEventsFlow.setOnAuthenticationMethodLoadStart(onAuthenticationMethodLoadStart);
OnInteractiveAuthFlowStartExternalUsersSelfServiceSignUp onInteractiveAuthFlowStart = new OnInteractiveAuthFlowStartExternalUsersSelfServiceSignUp();
onInteractiveAuthFlowStart.setOdataType("#microsoft.graph.onInteractiveAuthFlowStartExternalUsersSelfServiceSignUp");
onInteractiveAuthFlowStart.setIsSignUpAllowed(true);
authenticationEventsFlow.setOnInteractiveAuthFlowStart(onInteractiveAuthFlowStart);
OnAttributeCollectionExternalUsersSelfServiceSignUp onAttributeCollection = new OnAttributeCollectionExternalUsersSelfServiceSignUp();
onAttributeCollection.setOdataType("#microsoft.graph.onAttributeCollectionExternalUsersSelfServiceSignUp");
LinkedList<IdentityUserFlowAttribute> attributes = new LinkedList<IdentityUserFlowAttribute>();
IdentityUserFlowAttribute identityUserFlowAttribute = new IdentityUserFlowAttribute();
identityUserFlowAttribute.setId("email");
identityUserFlowAttribute.setDisplayName("Email Address");
identityUserFlowAttribute.setDescription("Email address of the user");
identityUserFlowAttribute.setUserFlowAttributeType(IdentityUserFlowAttributeType.BuiltIn);
identityUserFlowAttribute.setDataType(IdentityUserFlowAttributeDataType.String);
attributes.add(identityUserFlowAttribute);
IdentityUserFlowAttribute identityUserFlowAttribute1 = new IdentityUserFlowAttribute();
identityUserFlowAttribute1.setId("displayName");
identityUserFlowAttribute1.setDisplayName("Display Name");
identityUserFlowAttribute1.setDescription("Display Name of the User.");
identityUserFlowAttribute1.setUserFlowAttributeType(IdentityUserFlowAttributeType.BuiltIn);
identityUserFlowAttribute1.setDataType(IdentityUserFlowAttributeDataType.String);
attributes.add(identityUserFlowAttribute1);
IdentityUserFlowAttribute identityUserFlowAttribute2 = new IdentityUserFlowAttribute();
identityUserFlowAttribute2.setId("extension_6ea3bc85aec24b1c92ff4a117afb6621_Favoritecolor");
identityUserFlowAttribute2.setDisplayName("Favorite color");
identityUserFlowAttribute2.setDescription("what is your favorite color");
identityUserFlowAttribute2.setUserFlowAttributeType(IdentityUserFlowAttributeType.Custom);
identityUserFlowAttribute2.setDataType(IdentityUserFlowAttributeDataType.String);
attributes.add(identityUserFlowAttribute2);
onAttributeCollection.setAttributes(attributes);
AuthenticationAttributeCollectionPage attributeCollectionPage = new AuthenticationAttributeCollectionPage();
LinkedList<AuthenticationAttributeCollectionPageViewConfiguration> views = new LinkedList<AuthenticationAttributeCollectionPageViewConfiguration>();
AuthenticationAttributeCollectionPageViewConfiguration authenticationAttributeCollectionPageViewConfiguration = new AuthenticationAttributeCollectionPageViewConfiguration();
LinkedList<AuthenticationAttributeCollectionInputConfiguration> inputs = new LinkedList<AuthenticationAttributeCollectionInputConfiguration>();
AuthenticationAttributeCollectionInputConfiguration authenticationAttributeCollectionInputConfiguration = new AuthenticationAttributeCollectionInputConfiguration();
authenticationAttributeCollectionInputConfiguration.setAttribute("email");
authenticationAttributeCollectionInputConfiguration.setLabel("Email Address");
authenticationAttributeCollectionInputConfiguration.setInputType(AuthenticationAttributeCollectionInputType.Text);
authenticationAttributeCollectionInputConfiguration.setHidden(true);
authenticationAttributeCollectionInputConfiguration.setEditable(false);
authenticationAttributeCollectionInputConfiguration.setWriteToDirectory(true);
authenticationAttributeCollectionInputConfiguration.setRequired(true);
authenticationAttributeCollectionInputConfiguration.setValidationRegEx("^[a-zA-Z0-9.!#$%&’'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)*$");
inputs.add(authenticationAttributeCollectionInputConfiguration);
AuthenticationAttributeCollectionInputConfiguration authenticationAttributeCollectionInputConfiguration1 = new AuthenticationAttributeCollectionInputConfiguration();
authenticationAttributeCollectionInputConfiguration1.setAttribute("displayName");
authenticationAttributeCollectionInputConfiguration1.setLabel("Display Name");
authenticationAttributeCollectionInputConfiguration1.setInputType(AuthenticationAttributeCollectionInputType.Text);
authenticationAttributeCollectionInputConfiguration1.setHidden(false);
authenticationAttributeCollectionInputConfiguration1.setEditable(true);
authenticationAttributeCollectionInputConfiguration1.setWriteToDirectory(true);
authenticationAttributeCollectionInputConfiguration1.setRequired(false);
authenticationAttributeCollectionInputConfiguration1.setValidationRegEx("^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$");
inputs.add(authenticationAttributeCollectionInputConfiguration1);
AuthenticationAttributeCollectionInputConfiguration authenticationAttributeCollectionInputConfiguration2 = new AuthenticationAttributeCollectionInputConfiguration();
authenticationAttributeCollectionInputConfiguration2.setAttribute("extension_6ea3bc85aec24b1c92ff4a117afb6621_Favoritecolor");
authenticationAttributeCollectionInputConfiguration2.setLabel("Favorite color");
authenticationAttributeCollectionInputConfiguration2.setInputType(AuthenticationAttributeCollectionInputType.Text);
authenticationAttributeCollectionInputConfiguration2.setHidden(false);
authenticationAttributeCollectionInputConfiguration2.setEditable(true);
authenticationAttributeCollectionInputConfiguration2.setWriteToDirectory(true);
authenticationAttributeCollectionInputConfiguration2.setRequired(false);
authenticationAttributeCollectionInputConfiguration2.setValidationRegEx("^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$");
inputs.add(authenticationAttributeCollectionInputConfiguration2);
authenticationAttributeCollectionPageViewConfiguration.setInputs(inputs);
views.add(authenticationAttributeCollectionPageViewConfiguration);
attributeCollectionPage.setViews(views);
onAttributeCollection.setAttributeCollectionPage(attributeCollectionPage);
authenticationEventsFlow.setOnAttributeCollection(onAttributeCollection);
AuthenticationEventsFlow result = graphClient.identity().authenticationEventsFlows().post(authenticationEventsFlow);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
const options = {
authProvider,
};
const client = Client.init(options);
const authenticationEventsFlow = {
'@odata.type': '#microsoft.graph.externalUsersSelfServiceSignUpEventsFlow',
displayName: 'Woodgrove User Flow 2',
onAuthenticationMethodLoadStart: {
'@odata.type': '#microsoft.graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp',
identityProviders: [
{
id: 'EmailPassword-OAUTH'
},
{
id: 'Google-OAUTH'
},
{
id: 'Facebook-OAUTH'
}
]
},
onInteractiveAuthFlowStart: {
'@odata.type': '#microsoft.graph.onInteractiveAuthFlowStartExternalUsersSelfServiceSignUp',
isSignUpAllowed: true
},
onAttributeCollection: {
'@odata.type': '#microsoft.graph.onAttributeCollectionExternalUsersSelfServiceSignUp',
attributes: [
{
id: 'email',
displayName: 'Email Address',
description: 'Email address of the user',
userFlowAttributeType: 'builtIn',
dataType: 'string'
},
{
id: 'displayName',
displayName: 'Display Name',
description: 'Display Name of the User.',
userFlowAttributeType: 'builtIn',
dataType: 'string'
},
{
id: 'extension_6ea3bc85aec24b1c92ff4a117afb6621_Favoritecolor',
displayName: 'Favorite color',
description: 'what is your favorite color',
userFlowAttributeType: 'custom',
dataType: 'string'
}
],
attributeCollectionPage: {
views: [
{
inputs: [
{
attribute: 'email',
label: 'Email Address',
inputType: 'Text',
hidden: true,
editable: false,
writeToDirectory: true,
required: true,
validationRegEx: '^[a-zA-Z0-9.!#$%&’\'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)*$'
},
{
attribute: 'displayName',
label: 'Display Name',
inputType: 'text',
hidden: false,
editable: true,
writeToDirectory: true,
required: false,
validationRegEx: '^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$'
},
{
attribute: 'extension_6ea3bc85aec24b1c92ff4a117afb6621_Favoritecolor',
label: 'Favorite color',
inputType: 'text',
hidden: false,
editable: true,
writeToDirectory: true,
required: false,
validationRegEx: '^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$'
}
]
}
]
}
}
};
await client.api('/identity/authenticationEventsFlows')
.post(authenticationEventsFlow);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\ExternalUsersSelfServiceSignUpEventsFlow;
use Microsoft\Graph\Generated\Models\OnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp;
use Microsoft\Graph\Generated\Models\IdentityProviderBase;
use Microsoft\Graph\Generated\Models\OnInteractiveAuthFlowStartExternalUsersSelfServiceSignUp;
use Microsoft\Graph\Generated\Models\OnAttributeCollectionExternalUsersSelfServiceSignUp;
use Microsoft\Graph\Generated\Models\IdentityUserFlowAttribute;
use Microsoft\Graph\Generated\Models\IdentityUserFlowAttributeType;
use Microsoft\Graph\Generated\Models\IdentityUserFlowAttributeDataType;
use Microsoft\Graph\Generated\Models\AuthenticationAttributeCollectionPage;
use Microsoft\Graph\Generated\Models\AuthenticationAttributeCollectionPageViewConfiguration;
use Microsoft\Graph\Generated\Models\AuthenticationAttributeCollectionInputConfiguration;
use Microsoft\Graph\Generated\Models\AuthenticationAttributeCollectionInputType;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new ExternalUsersSelfServiceSignUpEventsFlow();
$requestBody->setOdataType('#microsoft.graph.externalUsersSelfServiceSignUpEventsFlow');
$requestBody->setDisplayName('Woodgrove User Flow 2');
$onAuthenticationMethodLoadStart = new OnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp();
$onAuthenticationMethodLoadStart->setOdataType('#microsoft.graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp');
$identityProvidersIdentityProviderBase1 = new IdentityProviderBase();
$identityProvidersIdentityProviderBase1->setId('EmailPassword-OAUTH');
$identityProvidersArray []= $identityProvidersIdentityProviderBase1;
$identityProvidersIdentityProviderBase2 = new IdentityProviderBase();
$identityProvidersIdentityProviderBase2->setId('Google-OAUTH');
$identityProvidersArray []= $identityProvidersIdentityProviderBase2;
$identityProvidersIdentityProviderBase3 = new IdentityProviderBase();
$identityProvidersIdentityProviderBase3->setId('Facebook-OAUTH');
$identityProvidersArray []= $identityProvidersIdentityProviderBase3;
$onAuthenticationMethodLoadStart->setIdentityProviders($identityProvidersArray);
$requestBody->setOnAuthenticationMethodLoadStart($onAuthenticationMethodLoadStart);
$onInteractiveAuthFlowStart = new OnInteractiveAuthFlowStartExternalUsersSelfServiceSignUp();
$onInteractiveAuthFlowStart->setOdataType('#microsoft.graph.onInteractiveAuthFlowStartExternalUsersSelfServiceSignUp');
$onInteractiveAuthFlowStart->setIsSignUpAllowed(true);
$requestBody->setOnInteractiveAuthFlowStart($onInteractiveAuthFlowStart);
$onAttributeCollection = new OnAttributeCollectionExternalUsersSelfServiceSignUp();
$onAttributeCollection->setOdataType('#microsoft.graph.onAttributeCollectionExternalUsersSelfServiceSignUp');
$attributesIdentityUserFlowAttribute1 = new IdentityUserFlowAttribute();
$attributesIdentityUserFlowAttribute1->setId('email');
$attributesIdentityUserFlowAttribute1->setDisplayName('Email Address');
$attributesIdentityUserFlowAttribute1->setDescription('Email address of the user');
$attributesIdentityUserFlowAttribute1->setUserFlowAttributeType(new IdentityUserFlowAttributeType('builtIn'));
$attributesIdentityUserFlowAttribute1->setDataType(new IdentityUserFlowAttributeDataType('string'));
$attributesArray []= $attributesIdentityUserFlowAttribute1;
$attributesIdentityUserFlowAttribute2 = new IdentityUserFlowAttribute();
$attributesIdentityUserFlowAttribute2->setId('displayName');
$attributesIdentityUserFlowAttribute2->setDisplayName('Display Name');
$attributesIdentityUserFlowAttribute2->setDescription('Display Name of the User.');
$attributesIdentityUserFlowAttribute2->setUserFlowAttributeType(new IdentityUserFlowAttributeType('builtIn'));
$attributesIdentityUserFlowAttribute2->setDataType(new IdentityUserFlowAttributeDataType('string'));
$attributesArray []= $attributesIdentityUserFlowAttribute2;
$attributesIdentityUserFlowAttribute3 = new IdentityUserFlowAttribute();
$attributesIdentityUserFlowAttribute3->setId('extension_6ea3bc85aec24b1c92ff4a117afb6621_Favoritecolor');
$attributesIdentityUserFlowAttribute3->setDisplayName('Favorite color');
$attributesIdentityUserFlowAttribute3->setDescription('what is your favorite color');
$attributesIdentityUserFlowAttribute3->setUserFlowAttributeType(new IdentityUserFlowAttributeType('custom'));
$attributesIdentityUserFlowAttribute3->setDataType(new IdentityUserFlowAttributeDataType('string'));
$attributesArray []= $attributesIdentityUserFlowAttribute3;
$onAttributeCollection->setAttributes($attributesArray);
$onAttributeCollectionAttributeCollectionPage = new AuthenticationAttributeCollectionPage();
$viewsAuthenticationAttributeCollectionPageViewConfiguration1 = new AuthenticationAttributeCollectionPageViewConfiguration();
$inputsAuthenticationAttributeCollectionInputConfiguration1 = new AuthenticationAttributeCollectionInputConfiguration();
$inputsAuthenticationAttributeCollectionInputConfiguration1->setAttribute('email');
$inputsAuthenticationAttributeCollectionInputConfiguration1->setLabel('Email Address');
$inputsAuthenticationAttributeCollectionInputConfiguration1->setInputType(new AuthenticationAttributeCollectionInputType('text'));
$inputsAuthenticationAttributeCollectionInputConfiguration1->setHidden(true);
$inputsAuthenticationAttributeCollectionInputConfiguration1->setEditable(false);
$inputsAuthenticationAttributeCollectionInputConfiguration1->setWriteToDirectory(true);
$inputsAuthenticationAttributeCollectionInputConfiguration1->setRequired(true);
$inputsAuthenticationAttributeCollectionInputConfiguration1->setValidationRegEx('^[a-zA-Z0-9.!#$%&’\'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)*$');
$inputsArray []= $inputsAuthenticationAttributeCollectionInputConfiguration1;
$inputsAuthenticationAttributeCollectionInputConfiguration2 = new AuthenticationAttributeCollectionInputConfiguration();
$inputsAuthenticationAttributeCollectionInputConfiguration2->setAttribute('displayName');
$inputsAuthenticationAttributeCollectionInputConfiguration2->setLabel('Display Name');
$inputsAuthenticationAttributeCollectionInputConfiguration2->setInputType(new AuthenticationAttributeCollectionInputType('text'));
$inputsAuthenticationAttributeCollectionInputConfiguration2->setHidden(false);
$inputsAuthenticationAttributeCollectionInputConfiguration2->setEditable(true);
$inputsAuthenticationAttributeCollectionInputConfiguration2->setWriteToDirectory(true);
$inputsAuthenticationAttributeCollectionInputConfiguration2->setRequired(false);
$inputsAuthenticationAttributeCollectionInputConfiguration2->setValidationRegEx('^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$');
$inputsArray []= $inputsAuthenticationAttributeCollectionInputConfiguration2;
$inputsAuthenticationAttributeCollectionInputConfiguration3 = new AuthenticationAttributeCollectionInputConfiguration();
$inputsAuthenticationAttributeCollectionInputConfiguration3->setAttribute('extension_6ea3bc85aec24b1c92ff4a117afb6621_Favoritecolor');
$inputsAuthenticationAttributeCollectionInputConfiguration3->setLabel('Favorite color');
$inputsAuthenticationAttributeCollectionInputConfiguration3->setInputType(new AuthenticationAttributeCollectionInputType('text'));
$inputsAuthenticationAttributeCollectionInputConfiguration3->setHidden(false);
$inputsAuthenticationAttributeCollectionInputConfiguration3->setEditable(true);
$inputsAuthenticationAttributeCollectionInputConfiguration3->setWriteToDirectory(true);
$inputsAuthenticationAttributeCollectionInputConfiguration3->setRequired(false);
$inputsAuthenticationAttributeCollectionInputConfiguration3->setValidationRegEx('^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$');
$inputsArray []= $inputsAuthenticationAttributeCollectionInputConfiguration3;
$viewsAuthenticationAttributeCollectionPageViewConfiguration1->setInputs($inputsArray);
$viewsArray []= $viewsAuthenticationAttributeCollectionPageViewConfiguration1;
$onAttributeCollectionAttributeCollectionPage->setViews($viewsArray);
$onAttributeCollection->setAttributeCollectionPage($onAttributeCollectionAttributeCollectionPage);
$requestBody->setOnAttributeCollection($onAttributeCollection);
$result = $graphServiceClient->identity()->authenticationEventsFlows()->post($requestBody)->wait();
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
Import-Module Microsoft.Graph.Identity.SignIns
$params = @{
"@odata.type" = "#microsoft.graph.externalUsersSelfServiceSignUpEventsFlow"
displayName = "Woodgrove User Flow 2"
onAuthenticationMethodLoadStart = @{
"@odata.type" = "#microsoft.graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp"
identityProviders = @(
@{
id = "EmailPassword-OAUTH"
}
@{
id = "Google-OAUTH"
}
@{
id = "Facebook-OAUTH"
}
)
}
onInteractiveAuthFlowStart = @{
"@odata.type" = "#microsoft.graph.onInteractiveAuthFlowStartExternalUsersSelfServiceSignUp"
isSignUpAllowed = $true
}
onAttributeCollection = @{
"@odata.type" = "#microsoft.graph.onAttributeCollectionExternalUsersSelfServiceSignUp"
attributes = @(
@{
id = "email"
displayName = "Email Address"
description = "Email address of the user"
userFlowAttributeType = "builtIn"
dataType = "string"
}
@{
id = "displayName"
displayName = "Display Name"
description = "Display Name of the User."
userFlowAttributeType = "builtIn"
dataType = "string"
}
@{
id = "extension_6ea3bc85aec24b1c92ff4a117afb6621_Favoritecolor"
displayName = "Favorite color"
description = "what is your favorite color"
userFlowAttributeType = "custom"
dataType = "string"
}
)
attributeCollectionPage = @{
views = @(
@{
inputs = @(
@{
attribute = "email"
label = "Email Address"
inputType = "Text"
hidden = $true
editable = $false
writeToDirectory = $true
required = $true
validationRegEx = "^[a-zA-Z0-9.!#$%&’'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)*$"
}
@{
attribute = "displayName"
label = "Display Name"
inputType = "text"
hidden = $false
editable = $true
writeToDirectory = $true
required = $false
validationRegEx = "^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$"
}
@{
attribute = "extension_6ea3bc85aec24b1c92ff4a117afb6621_Favoritecolor"
label = "Favorite color"
inputType = "text"
hidden = $false
editable = $true
writeToDirectory = $true
required = $false
validationRegEx = "^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$"
}
)
}
)
}
}
}
New-MgIdentityAuthenticationEventFlow -BodyParameter $params
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.external_users_self_service_sign_up_events_flow import ExternalUsersSelfServiceSignUpEventsFlow
from msgraph.generated.models.on_authentication_method_load_start_external_users_self_service_sign_up import OnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp
from msgraph.generated.models.identity_provider_base import IdentityProviderBase
from msgraph.generated.models.on_interactive_auth_flow_start_external_users_self_service_sign_up import OnInteractiveAuthFlowStartExternalUsersSelfServiceSignUp
from msgraph.generated.models.on_attribute_collection_external_users_self_service_sign_up import OnAttributeCollectionExternalUsersSelfServiceSignUp
from msgraph.generated.models.identity_user_flow_attribute import IdentityUserFlowAttribute
from msgraph.generated.models.identity_user_flow_attribute_type import IdentityUserFlowAttributeType
from msgraph.generated.models.identity_user_flow_attribute_data_type import IdentityUserFlowAttributeDataType
from msgraph.generated.models.authentication_attribute_collection_page import AuthenticationAttributeCollectionPage
from msgraph.generated.models.authentication_attribute_collection_page_view_configuration import AuthenticationAttributeCollectionPageViewConfiguration
from msgraph.generated.models.authentication_attribute_collection_input_configuration import AuthenticationAttributeCollectionInputConfiguration
from msgraph.generated.models.authentication_attribute_collection_input_type import AuthenticationAttributeCollectionInputType
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = ExternalUsersSelfServiceSignUpEventsFlow(
odata_type = "#microsoft.graph.externalUsersSelfServiceSignUpEventsFlow",
display_name = "Woodgrove User Flow 2",
on_authentication_method_load_start = OnAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp(
odata_type = "#microsoft.graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp",
identity_providers = [
IdentityProviderBase(
id = "EmailPassword-OAUTH",
),
IdentityProviderBase(
id = "Google-OAUTH",
),
IdentityProviderBase(
id = "Facebook-OAUTH",
),
],
),
on_interactive_auth_flow_start = OnInteractiveAuthFlowStartExternalUsersSelfServiceSignUp(
odata_type = "#microsoft.graph.onInteractiveAuthFlowStartExternalUsersSelfServiceSignUp",
is_sign_up_allowed = True,
),
on_attribute_collection = OnAttributeCollectionExternalUsersSelfServiceSignUp(
odata_type = "#microsoft.graph.onAttributeCollectionExternalUsersSelfServiceSignUp",
attributes = [
IdentityUserFlowAttribute(
id = "email",
display_name = "Email Address",
description = "Email address of the user",
user_flow_attribute_type = IdentityUserFlowAttributeType.BuiltIn,
data_type = IdentityUserFlowAttributeDataType.String,
),
IdentityUserFlowAttribute(
id = "displayName",
display_name = "Display Name",
description = "Display Name of the User.",
user_flow_attribute_type = IdentityUserFlowAttributeType.BuiltIn,
data_type = IdentityUserFlowAttributeDataType.String,
),
IdentityUserFlowAttribute(
id = "extension_6ea3bc85aec24b1c92ff4a117afb6621_Favoritecolor",
display_name = "Favorite color",
description = "what is your favorite color",
user_flow_attribute_type = IdentityUserFlowAttributeType.Custom,
data_type = IdentityUserFlowAttributeDataType.String,
),
],
attribute_collection_page = AuthenticationAttributeCollectionPage(
views = [
AuthenticationAttributeCollectionPageViewConfiguration(
inputs = [
AuthenticationAttributeCollectionInputConfiguration(
attribute = "email",
label = "Email Address",
input_type = AuthenticationAttributeCollectionInputType.Text,
hidden = True,
editable = False,
write_to_directory = True,
required = True,
validation_reg_ex = "^[a-zA-Z0-9.!#$%&’'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)*$",
),
AuthenticationAttributeCollectionInputConfiguration(
attribute = "displayName",
label = "Display Name",
input_type = AuthenticationAttributeCollectionInputType.Text,
hidden = False,
editable = True,
write_to_directory = True,
required = False,
validation_reg_ex = "^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$",
),
AuthenticationAttributeCollectionInputConfiguration(
attribute = "extension_6ea3bc85aec24b1c92ff4a117afb6621_Favoritecolor",
label = "Favorite color",
input_type = AuthenticationAttributeCollectionInputType.Text,
hidden = False,
editable = True,
write_to_directory = True,
required = False,
validation_reg_ex = "^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$",
),
],
),
],
),
),
)
result = await graph_client.identity.authentication_events_flows.post(request_body)
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
応答
次の例は応答を示しています。
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 201 Created
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#identity/authenticationEventsFlows/$entity",
"@odata.type": "#microsoft.graph.externalUsersSelfServiceSignUpEventsFlow",
"id": "{authentictionEventsFlow-id}",
"displayName": "Woodgrove User Flow 2",
"description": null,
"onUserCreateStart": null,
"conditions": {
"applications": {
"includeAllApplications": false
}
},
"onInteractiveAuthFlowStart": {
"@odata.type": "#microsoft.graph.onInteractiveAuthFlowStartExternalUsersSelfServiceSignUp",
"isSignUpAllowed": true
},
"onAuthenticationMethodLoadStart": {
"@odata.type": "#microsoft.graph.onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp"
},
"onAttributeCollection": {
"@odata.type": "#microsoft.graph.onAttributeCollectionExternalUsersSelfServiceSignUp",
"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": false,
"validationRegEx": "^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$",
"options": []
},
{
"attribute": "extension_6ea3bc85aec24b1c92ff4a117afb6621_Favoritecolor",
"label": "Favorite color",
"inputType": "text",
"defaultValue": null,
"hidden": false,
"editable": true,
"writeToDirectory": true,
"required": false,
"validationRegEx": "^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$",
"options": []
}
]
}
]
}
}
}