Выберите разрешение или разрешения, помеченные как наименее привилегированные для этого API. Используйте более привилегированное разрешение или разрешения только в том случае, если это требуется приложению. Дополнительные сведения о делегированных разрешениях и разрешениях приложений см. в разделе Типы разрешений. Дополнительные сведения об этих разрешениях см. в справочнике по разрешениям.
В делегированных сценариях с рабочими или учебными учетными записями вошедшего пользователя должен быть владельцем или членом группы либо ему должна быть назначена поддерживаемая роль Microsoft Entra или пользовательская роль с разрешением поддерживаемой роли.
Администратор потока внешних идентификаторов — это следующая наименее привилегированная роль, поддерживаемая для этой операции.
В следующей таблице указаны свойства, которые можно обновить.
В следующем примере показан запрос, который обновляет отображаемое имя определенного потока пользователя внешних удостоверений.
PATCH https://graph.microsoft.com/v1.0/identity/authenticationEventsFlows/0313cc37-d421-421d-857b-87804d61e33e
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.externalUsersSelfServiceSignUpEventsFlow",
"displayName": "New user flow description",
}
// 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 = "New user flow description",
};
// 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["{authenticationEventsFlow-id}"].PatchAsync(requestBody);
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider, см. в документации по SDK.
mgc identity authentication-events-flows patch --authentication-events-flow-id {authenticationEventsFlow-id} --body '{\
"@odata.type": "#microsoft.graph.externalUsersSelfServiceSignUpEventsFlow",\
"displayName": "New user flow description",\
}\
'
Подробнее о том, как добавить 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 := "New user flow description"
requestBody.SetDisplayName(&displayName)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
authenticationEventsFlows, err := graphClient.Identity().AuthenticationEventsFlows().ByAuthenticationEventsFlowId("authenticationEventsFlow-id").Patch(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("New user flow description");
AuthenticationEventsFlow result = graphClient.identity().authenticationEventsFlows().byAuthenticationEventsFlowId("{authenticationEventsFlow-id}").patch(authenticationEventsFlow);
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider, см. в документации по SDK.
const options = {
authProvider,
};
const client = Client.init(options);
const authenticationEventsFlow = {
'@odata.type': '#microsoft.graph.externalUsersSelfServiceSignUpEventsFlow',
displayName: 'New user flow description',
};
await client.api('/identity/authenticationEventsFlows/0313cc37-d421-421d-857b-87804d61e33e')
.update(authenticationEventsFlow);
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider, см. в документации по SDK.
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\ExternalUsersSelfServiceSignUpEventsFlow;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new ExternalUsersSelfServiceSignUpEventsFlow();
$requestBody->setOdataType('#microsoft.graph.externalUsersSelfServiceSignUpEventsFlow');
$requestBody->setDisplayName('New user flow description');
$result = $graphServiceClient->identity()->authenticationEventsFlows()->byAuthenticationEventsFlowId('authenticationEventsFlow-id')->patch($requestBody)->wait();
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider, см. в документации по SDK.
Import-Module Microsoft.Graph.Identity.SignIns
$params = @{
"@odata.type" = "#microsoft.graph.externalUsersSelfServiceSignUpEventsFlow"
displayName = "New user flow description"
}
Update-MgIdentityAuthenticationEventFlow -AuthenticationEventsFlowId $authenticationEventsFlowId -BodyParameter $params
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider, см. в документации по SDK.
from msgraph import GraphServiceClient
from msgraph.generated.models.external_users_self_service_sign_up_events_flow import ExternalUsersSelfServiceSignUpEventsFlow
graph_client = GraphServiceClient(credentials, scopes)
request_body = ExternalUsersSelfServiceSignUpEventsFlow(
odata_type = "#microsoft.graph.externalUsersSelfServiceSignUpEventsFlow",
display_name = "New user flow description",
)
result = await graph_client.identity.authentication_events_flows.by_authentication_events_flow_id('authenticationEventsFlow-id').patch(request_body)
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider, см. в документации по SDK.
Ниже показан пример отклика.
Следующий запрос обновляет конфигурацию некоторых атрибутов. Все атрибуты помечаются как обязательные; атрибут электронной почты помечается как скрытый; Тип ввода настраиваемого атрибута также обновляется до переключателя с двумя параметрами.
PATCH https://graph.microsoft.com/v1.0/identity/authenticationEventsFlows/0313cc37-d421-421d-857b-87804d61e33e
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.externalUsersSelfServiceSignUpEventsFlow",
"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": true,
"validationRegEx": "^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$",
"options": []
},
{
"attribute": "city",
"label": "City",
"inputType": "text",
"defaultValue": null,
"hidden": false,
"editable": true,
"writeToDirectory": true,
"required": true,
"validationRegEx": "^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$",
"options": []
},
{
"attribute": "extension_331d514c0c18477583ea7dd5a79feda2_RockorCountry",
"label": "Rock music or Country",
"inputType": "radioSingleSelect",
"defaultValue": null,
"hidden": false,
"editable": true,
"writeToDirectory": true,
"required": true,
"validationRegEx": "^.*",
"options": [
{
"label": "Rock music",
"value": "Rock"
},
{
"label": "Country music",
"value": "Country"
}
]
}
]
}
]
}
}
}
// 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",
OnAttributeCollection = new OnAttributeCollectionExternalUsersSelfServiceSignUp
{
OdataType = "#microsoft.graph.onAttributeCollectionExternalUsersSelfServiceSignUp",
AttributeCollectionPage = new AuthenticationAttributeCollectionPage
{
Views = new List<AuthenticationAttributeCollectionPageViewConfiguration>
{
new AuthenticationAttributeCollectionPageViewConfiguration
{
Title = null,
Description = null,
Inputs = new List<AuthenticationAttributeCollectionInputConfiguration>
{
new AuthenticationAttributeCollectionInputConfiguration
{
Attribute = "email",
Label = "Email Address",
InputType = AuthenticationAttributeCollectionInputType.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 = new List<AuthenticationAttributeCollectionOptionConfiguration>
{
},
},
new AuthenticationAttributeCollectionInputConfiguration
{
Attribute = "displayName",
Label = "Display Name",
InputType = AuthenticationAttributeCollectionInputType.Text,
DefaultValue = null,
Hidden = false,
Editable = true,
WriteToDirectory = true,
Required = false,
ValidationRegEx = "^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$",
Options = new List<AuthenticationAttributeCollectionOptionConfiguration>
{
},
},
new AuthenticationAttributeCollectionInputConfiguration
{
Attribute = "city",
Label = "City",
InputType = AuthenticationAttributeCollectionInputType.Text,
DefaultValue = null,
Hidden = false,
Editable = true,
WriteToDirectory = true,
Required = false,
ValidationRegEx = "^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$",
Options = new List<AuthenticationAttributeCollectionOptionConfiguration>
{
},
},
new AuthenticationAttributeCollectionInputConfiguration
{
Attribute = "extension_6ea3bc85aec24b1c92ff4a117afb6621_Favoritecolor",
Label = "Favorite color",
InputType = AuthenticationAttributeCollectionInputType.Text,
DefaultValue = null,
Hidden = false,
Editable = true,
WriteToDirectory = true,
Required = false,
ValidationRegEx = "^.*",
Options = new List<AuthenticationAttributeCollectionOptionConfiguration>
{
},
},
},
},
},
},
},
};
// 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["{authenticationEventsFlow-id}"].PatchAsync(requestBody);
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider, см. в документации по SDK.
mgc identity authentication-events-flows patch --authentication-events-flow-id {authenticationEventsFlow-id} --body '{\
"@odata.type": "#microsoft.graph.externalUsersSelfServiceSignUpEventsFlow",\
"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": []\
},\
{\
"attribute": "city",\
"label": "City",\
"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": "^.*",\
"options": []\
}\
]\
}\
]\
}\
}\
}\
'
Подробнее о том, как добавить 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()
onAttributeCollection := graphmodels.NewOnAttributeCollectionExternalUsersSelfServiceSignUp()
attributeCollectionPage := graphmodels.NewAuthenticationAttributeCollectionPage()
authenticationAttributeCollectionPageViewConfiguration := graphmodels.NewAuthenticationAttributeCollectionPageViewConfiguration()
title := null
authenticationAttributeCollectionPageViewConfiguration.SetTitle(&title)
description := null
authenticationAttributeCollectionPageViewConfiguration.SetDescription(&description)
authenticationAttributeCollectionInputConfiguration := graphmodels.NewAuthenticationAttributeCollectionInputConfiguration()
attribute := "email"
authenticationAttributeCollectionInputConfiguration.SetAttribute(&attribute)
label := "Email Address"
authenticationAttributeCollectionInputConfiguration.SetLabel(&label)
inputType := graphmodels.TEXT_AUTHENTICATIONATTRIBUTECOLLECTIONINPUTTYPE
authenticationAttributeCollectionInputConfiguration.SetInputType(&inputType)
defaultValue := null
authenticationAttributeCollectionInputConfiguration.SetDefaultValue(&defaultValue)
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)
options := []graphmodels.AuthenticationAttributeCollectionOptionConfigurationable {
}
authenticationAttributeCollectionInputConfiguration.SetOptions(options)
authenticationAttributeCollectionInputConfiguration1 := graphmodels.NewAuthenticationAttributeCollectionInputConfiguration()
attribute := "displayName"
authenticationAttributeCollectionInputConfiguration1.SetAttribute(&attribute)
label := "Display Name"
authenticationAttributeCollectionInputConfiguration1.SetLabel(&label)
inputType := graphmodels.TEXT_AUTHENTICATIONATTRIBUTECOLLECTIONINPUTTYPE
authenticationAttributeCollectionInputConfiguration1.SetInputType(&inputType)
defaultValue := null
authenticationAttributeCollectionInputConfiguration1.SetDefaultValue(&defaultValue)
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)
options := []graphmodels.AuthenticationAttributeCollectionOptionConfigurationable {
}
authenticationAttributeCollectionInputConfiguration1.SetOptions(options)
authenticationAttributeCollectionInputConfiguration2 := graphmodels.NewAuthenticationAttributeCollectionInputConfiguration()
attribute := "city"
authenticationAttributeCollectionInputConfiguration2.SetAttribute(&attribute)
label := "City"
authenticationAttributeCollectionInputConfiguration2.SetLabel(&label)
inputType := graphmodels.TEXT_AUTHENTICATIONATTRIBUTECOLLECTIONINPUTTYPE
authenticationAttributeCollectionInputConfiguration2.SetInputType(&inputType)
defaultValue := null
authenticationAttributeCollectionInputConfiguration2.SetDefaultValue(&defaultValue)
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)
options := []graphmodels.AuthenticationAttributeCollectionOptionConfigurationable {
}
authenticationAttributeCollectionInputConfiguration2.SetOptions(options)
authenticationAttributeCollectionInputConfiguration3 := graphmodels.NewAuthenticationAttributeCollectionInputConfiguration()
attribute := "extension_6ea3bc85aec24b1c92ff4a117afb6621_Favoritecolor"
authenticationAttributeCollectionInputConfiguration3.SetAttribute(&attribute)
label := "Favorite color"
authenticationAttributeCollectionInputConfiguration3.SetLabel(&label)
inputType := graphmodels.TEXT_AUTHENTICATIONATTRIBUTECOLLECTIONINPUTTYPE
authenticationAttributeCollectionInputConfiguration3.SetInputType(&inputType)
defaultValue := null
authenticationAttributeCollectionInputConfiguration3.SetDefaultValue(&defaultValue)
hidden := false
authenticationAttributeCollectionInputConfiguration3.SetHidden(&hidden)
editable := true
authenticationAttributeCollectionInputConfiguration3.SetEditable(&editable)
writeToDirectory := true
authenticationAttributeCollectionInputConfiguration3.SetWriteToDirectory(&writeToDirectory)
required := false
authenticationAttributeCollectionInputConfiguration3.SetRequired(&required)
validationRegEx := "^.*"
authenticationAttributeCollectionInputConfiguration3.SetValidationRegEx(&validationRegEx)
options := []graphmodels.AuthenticationAttributeCollectionOptionConfigurationable {
}
authenticationAttributeCollectionInputConfiguration3.SetOptions(options)
inputs := []graphmodels.AuthenticationAttributeCollectionInputConfigurationable {
authenticationAttributeCollectionInputConfiguration,
authenticationAttributeCollectionInputConfiguration1,
authenticationAttributeCollectionInputConfiguration2,
authenticationAttributeCollectionInputConfiguration3,
}
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().ByAuthenticationEventsFlowId("authenticationEventsFlow-id").Patch(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");
OnAttributeCollectionExternalUsersSelfServiceSignUp onAttributeCollection = new OnAttributeCollectionExternalUsersSelfServiceSignUp();
onAttributeCollection.setOdataType("#microsoft.graph.onAttributeCollectionExternalUsersSelfServiceSignUp");
AuthenticationAttributeCollectionPage attributeCollectionPage = new AuthenticationAttributeCollectionPage();
LinkedList<AuthenticationAttributeCollectionPageViewConfiguration> views = new LinkedList<AuthenticationAttributeCollectionPageViewConfiguration>();
AuthenticationAttributeCollectionPageViewConfiguration authenticationAttributeCollectionPageViewConfiguration = new AuthenticationAttributeCollectionPageViewConfiguration();
authenticationAttributeCollectionPageViewConfiguration.setTitle(null);
authenticationAttributeCollectionPageViewConfiguration.setDescription(null);
LinkedList<AuthenticationAttributeCollectionInputConfiguration> inputs = new LinkedList<AuthenticationAttributeCollectionInputConfiguration>();
AuthenticationAttributeCollectionInputConfiguration authenticationAttributeCollectionInputConfiguration = new AuthenticationAttributeCollectionInputConfiguration();
authenticationAttributeCollectionInputConfiguration.setAttribute("email");
authenticationAttributeCollectionInputConfiguration.setLabel("Email Address");
authenticationAttributeCollectionInputConfiguration.setInputType(AuthenticationAttributeCollectionInputType.Text);
authenticationAttributeCollectionInputConfiguration.setDefaultValue(null);
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-]+)*$");
LinkedList<AuthenticationAttributeCollectionOptionConfiguration> options = new LinkedList<AuthenticationAttributeCollectionOptionConfiguration>();
authenticationAttributeCollectionInputConfiguration.setOptions(options);
inputs.add(authenticationAttributeCollectionInputConfiguration);
AuthenticationAttributeCollectionInputConfiguration authenticationAttributeCollectionInputConfiguration1 = new AuthenticationAttributeCollectionInputConfiguration();
authenticationAttributeCollectionInputConfiguration1.setAttribute("displayName");
authenticationAttributeCollectionInputConfiguration1.setLabel("Display Name");
authenticationAttributeCollectionInputConfiguration1.setInputType(AuthenticationAttributeCollectionInputType.Text);
authenticationAttributeCollectionInputConfiguration1.setDefaultValue(null);
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_]+$");
LinkedList<AuthenticationAttributeCollectionOptionConfiguration> options1 = new LinkedList<AuthenticationAttributeCollectionOptionConfiguration>();
authenticationAttributeCollectionInputConfiguration1.setOptions(options1);
inputs.add(authenticationAttributeCollectionInputConfiguration1);
AuthenticationAttributeCollectionInputConfiguration authenticationAttributeCollectionInputConfiguration2 = new AuthenticationAttributeCollectionInputConfiguration();
authenticationAttributeCollectionInputConfiguration2.setAttribute("city");
authenticationAttributeCollectionInputConfiguration2.setLabel("City");
authenticationAttributeCollectionInputConfiguration2.setInputType(AuthenticationAttributeCollectionInputType.Text);
authenticationAttributeCollectionInputConfiguration2.setDefaultValue(null);
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_]+$");
LinkedList<AuthenticationAttributeCollectionOptionConfiguration> options2 = new LinkedList<AuthenticationAttributeCollectionOptionConfiguration>();
authenticationAttributeCollectionInputConfiguration2.setOptions(options2);
inputs.add(authenticationAttributeCollectionInputConfiguration2);
AuthenticationAttributeCollectionInputConfiguration authenticationAttributeCollectionInputConfiguration3 = new AuthenticationAttributeCollectionInputConfiguration();
authenticationAttributeCollectionInputConfiguration3.setAttribute("extension_6ea3bc85aec24b1c92ff4a117afb6621_Favoritecolor");
authenticationAttributeCollectionInputConfiguration3.setLabel("Favorite color");
authenticationAttributeCollectionInputConfiguration3.setInputType(AuthenticationAttributeCollectionInputType.Text);
authenticationAttributeCollectionInputConfiguration3.setDefaultValue(null);
authenticationAttributeCollectionInputConfiguration3.setHidden(false);
authenticationAttributeCollectionInputConfiguration3.setEditable(true);
authenticationAttributeCollectionInputConfiguration3.setWriteToDirectory(true);
authenticationAttributeCollectionInputConfiguration3.setRequired(false);
authenticationAttributeCollectionInputConfiguration3.setValidationRegEx("^.*");
LinkedList<AuthenticationAttributeCollectionOptionConfiguration> options3 = new LinkedList<AuthenticationAttributeCollectionOptionConfiguration>();
authenticationAttributeCollectionInputConfiguration3.setOptions(options3);
inputs.add(authenticationAttributeCollectionInputConfiguration3);
authenticationAttributeCollectionPageViewConfiguration.setInputs(inputs);
views.add(authenticationAttributeCollectionPageViewConfiguration);
attributeCollectionPage.setViews(views);
onAttributeCollection.setAttributeCollectionPage(attributeCollectionPage);
authenticationEventsFlow.setOnAttributeCollection(onAttributeCollection);
AuthenticationEventsFlow result = graphClient.identity().authenticationEventsFlows().byAuthenticationEventsFlowId("{authenticationEventsFlow-id}").patch(authenticationEventsFlow);
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider, см. в документации по SDK.
const options = {
authProvider,
};
const client = Client.init(options);
const authenticationEventsFlow = {
'@odata.type': '#microsoft.graph.externalUsersSelfServiceSignUpEventsFlow',
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: []
},
{
attribute: 'city',
label: 'City',
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: '^.*',
options: []
}
]
}
]
}
}
};
await client.api('/identity/authenticationEventsFlows/0313cc37-d421-421d-857b-87804d61e33e')
.update(authenticationEventsFlow);
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider, см. в документации по SDK.
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\ExternalUsersSelfServiceSignUpEventsFlow;
use Microsoft\Graph\Generated\Models\OnAttributeCollectionExternalUsersSelfServiceSignUp;
use Microsoft\Graph\Generated\Models\AuthenticationAttributeCollectionPage;
use Microsoft\Graph\Generated\Models\AuthenticationAttributeCollectionPageViewConfiguration;
use Microsoft\Graph\Generated\Models\AuthenticationAttributeCollectionInputConfiguration;
use Microsoft\Graph\Generated\Models\AuthenticationAttributeCollectionInputType;
use Microsoft\Graph\Generated\Models\AuthenticationAttributeCollectionOptionConfiguration;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new ExternalUsersSelfServiceSignUpEventsFlow();
$requestBody->setOdataType('#microsoft.graph.externalUsersSelfServiceSignUpEventsFlow');
$onAttributeCollection = new OnAttributeCollectionExternalUsersSelfServiceSignUp();
$onAttributeCollection->setOdataType('#microsoft.graph.onAttributeCollectionExternalUsersSelfServiceSignUp');
$onAttributeCollectionAttributeCollectionPage = new AuthenticationAttributeCollectionPage();
$viewsAuthenticationAttributeCollectionPageViewConfiguration1 = new AuthenticationAttributeCollectionPageViewConfiguration();
$viewsAuthenticationAttributeCollectionPageViewConfiguration1->setTitle(null);
$viewsAuthenticationAttributeCollectionPageViewConfiguration1->setDescription(null);
$inputsAuthenticationAttributeCollectionInputConfiguration1 = new AuthenticationAttributeCollectionInputConfiguration();
$inputsAuthenticationAttributeCollectionInputConfiguration1->setAttribute('email');
$inputsAuthenticationAttributeCollectionInputConfiguration1->setLabel('Email Address');
$inputsAuthenticationAttributeCollectionInputConfiguration1->setInputType(new AuthenticationAttributeCollectionInputType('text'));
$inputsAuthenticationAttributeCollectionInputConfiguration1->setDefaultValue(null);
$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-]+)*$');
$inputsAuthenticationAttributeCollectionInputConfiguration1->setOptions([ ]);
$inputsArray []= $inputsAuthenticationAttributeCollectionInputConfiguration1;
$inputsAuthenticationAttributeCollectionInputConfiguration2 = new AuthenticationAttributeCollectionInputConfiguration();
$inputsAuthenticationAttributeCollectionInputConfiguration2->setAttribute('displayName');
$inputsAuthenticationAttributeCollectionInputConfiguration2->setLabel('Display Name');
$inputsAuthenticationAttributeCollectionInputConfiguration2->setInputType(new AuthenticationAttributeCollectionInputType('text'));
$inputsAuthenticationAttributeCollectionInputConfiguration2->setDefaultValue(null);
$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_]+$');
$inputsAuthenticationAttributeCollectionInputConfiguration2->setOptions([ ]);
$inputsArray []= $inputsAuthenticationAttributeCollectionInputConfiguration2;
$inputsAuthenticationAttributeCollectionInputConfiguration3 = new AuthenticationAttributeCollectionInputConfiguration();
$inputsAuthenticationAttributeCollectionInputConfiguration3->setAttribute('city');
$inputsAuthenticationAttributeCollectionInputConfiguration3->setLabel('City');
$inputsAuthenticationAttributeCollectionInputConfiguration3->setInputType(new AuthenticationAttributeCollectionInputType('text'));
$inputsAuthenticationAttributeCollectionInputConfiguration3->setDefaultValue(null);
$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_]+$');
$inputsAuthenticationAttributeCollectionInputConfiguration3->setOptions([ ]);
$inputsArray []= $inputsAuthenticationAttributeCollectionInputConfiguration3;
$inputsAuthenticationAttributeCollectionInputConfiguration4 = new AuthenticationAttributeCollectionInputConfiguration();
$inputsAuthenticationAttributeCollectionInputConfiguration4->setAttribute('extension_6ea3bc85aec24b1c92ff4a117afb6621_Favoritecolor');
$inputsAuthenticationAttributeCollectionInputConfiguration4->setLabel('Favorite color');
$inputsAuthenticationAttributeCollectionInputConfiguration4->setInputType(new AuthenticationAttributeCollectionInputType('text'));
$inputsAuthenticationAttributeCollectionInputConfiguration4->setDefaultValue(null);
$inputsAuthenticationAttributeCollectionInputConfiguration4->setHidden(false);
$inputsAuthenticationAttributeCollectionInputConfiguration4->setEditable(true);
$inputsAuthenticationAttributeCollectionInputConfiguration4->setWriteToDirectory(true);
$inputsAuthenticationAttributeCollectionInputConfiguration4->setRequired(false);
$inputsAuthenticationAttributeCollectionInputConfiguration4->setValidationRegEx('^.*');
$inputsAuthenticationAttributeCollectionInputConfiguration4->setOptions([ ]);
$inputsArray []= $inputsAuthenticationAttributeCollectionInputConfiguration4;
$viewsAuthenticationAttributeCollectionPageViewConfiguration1->setInputs($inputsArray);
$viewsArray []= $viewsAuthenticationAttributeCollectionPageViewConfiguration1;
$onAttributeCollectionAttributeCollectionPage->setViews($viewsArray);
$onAttributeCollection->setAttributeCollectionPage($onAttributeCollectionAttributeCollectionPage);
$requestBody->setOnAttributeCollection($onAttributeCollection);
$result = $graphServiceClient->identity()->authenticationEventsFlows()->byAuthenticationEventsFlowId('authenticationEventsFlow-id')->patch($requestBody)->wait();
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider, см. в документации по SDK.
Import-Module Microsoft.Graph.Identity.SignIns
$params = @{
"@odata.type" = "#microsoft.graph.externalUsersSelfServiceSignUpEventsFlow"
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 = @(
)
}
@{
attribute = "city"
label = "City"
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 = "^.*"
options = @(
)
}
)
}
)
}
}
}
Update-MgIdentityAuthenticationEventFlow -AuthenticationEventsFlowId $authenticationEventsFlowId -BodyParameter $params
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider, см. в документации по SDK.
from msgraph import GraphServiceClient
from msgraph.generated.models.external_users_self_service_sign_up_events_flow import ExternalUsersSelfServiceSignUpEventsFlow
from msgraph.generated.models.on_attribute_collection_external_users_self_service_sign_up import OnAttributeCollectionExternalUsersSelfServiceSignUp
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
from msgraph.generated.models.authentication_attribute_collection_option_configuration import AuthenticationAttributeCollectionOptionConfiguration
graph_client = GraphServiceClient(credentials, scopes)
request_body = ExternalUsersSelfServiceSignUpEventsFlow(
odata_type = "#microsoft.graph.externalUsersSelfServiceSignUpEventsFlow",
on_attribute_collection = OnAttributeCollectionExternalUsersSelfServiceSignUp(
odata_type = "#microsoft.graph.onAttributeCollectionExternalUsersSelfServiceSignUp",
attribute_collection_page = AuthenticationAttributeCollectionPage(
views = [
AuthenticationAttributeCollectionPageViewConfiguration(
title = None,
description = None,
inputs = [
AuthenticationAttributeCollectionInputConfiguration(
attribute = "email",
label = "Email Address",
input_type = AuthenticationAttributeCollectionInputType.Text,
default_value = None,
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-]+)*$",
options = [
],
),
AuthenticationAttributeCollectionInputConfiguration(
attribute = "displayName",
label = "Display Name",
input_type = AuthenticationAttributeCollectionInputType.Text,
default_value = None,
hidden = False,
editable = True,
write_to_directory = True,
required = False,
validation_reg_ex = "^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$",
options = [
],
),
AuthenticationAttributeCollectionInputConfiguration(
attribute = "city",
label = "City",
input_type = AuthenticationAttributeCollectionInputType.Text,
default_value = None,
hidden = False,
editable = True,
write_to_directory = True,
required = False,
validation_reg_ex = "^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$",
options = [
],
),
AuthenticationAttributeCollectionInputConfiguration(
attribute = "extension_6ea3bc85aec24b1c92ff4a117afb6621_Favoritecolor",
label = "Favorite color",
input_type = AuthenticationAttributeCollectionInputType.Text,
default_value = None,
hidden = False,
editable = True,
write_to_directory = True,
required = False,
validation_reg_ex = "^.*",
options = [
],
),
],
),
],
),
),
)
result = await graph_client.identity.authentication_events_flows.by_authentication_events_flow_id('authenticationEventsFlow-id').patch(request_body)
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider, см. в документации по SDK.
Ниже приводится пример отклика.