Dans les scénarios délégués avec des comptes professionnels ou scolaires, l’utilisateur connecté doit se voir attribuer un rôle Microsoft Entra pris en charge ou un rôle personnalisé avec une autorisation de rôle prise en charge.
ID externe’administrateur de flux utilisateur est le rôle le moins privilégié pris en charge pour cette opération.
Requête HTTP
POST /identity/b2cUserFlows/{b2cIdentityUserFlowId}/userAttributeAssignments/setOrder
POST /identity/b2xUserFlows/{b2xIdentityUserFlowId}/userAttributeAssignments/setOrder
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Identity.B2cUserFlows.Item.UserAttributeAssignments.SetOrder;
using Microsoft.Graph.Beta.Models;
var requestBody = new SetOrderPostRequestBody
{
NewAssignmentOrder = new AssignmentOrder
{
Order = new List<string>
{
"City",
"extension_GUID_ShoeSize",
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.Identity.B2cUserFlows["{b2cIdentityUserFlow-id}"].UserAttributeAssignments.SetOrder.PostAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphidentity "github.com/microsoftgraph/msgraph-beta-sdk-go/identity"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphidentity.NewSetOrderPostRequestBody()
newAssignmentOrder := graphmodels.NewAssignmentOrder()
order := []string {
"City",
"extension_GUID_ShoeSize",
}
newAssignmentOrder.SetOrder(order)
requestBody.SetNewAssignmentOrder(newAssignmentOrder)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
graphClient.Identity().B2cUserFlows().ByB2cIdentityUserFlowId("b2cIdentityUserFlow-id").UserAttributeAssignments().SetOrder().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.beta.identity.b2cuserflows.item.userattributeassignments.setorder.SetOrderPostRequestBody setOrderPostRequestBody = new com.microsoft.graph.beta.identity.b2cuserflows.item.userattributeassignments.setorder.SetOrderPostRequestBody();
AssignmentOrder newAssignmentOrder = new AssignmentOrder();
LinkedList<String> order = new LinkedList<String>();
order.add("City");
order.add("extension_GUID_ShoeSize");
newAssignmentOrder.setOrder(order);
setOrderPostRequestBody.setNewAssignmentOrder(newAssignmentOrder);
graphClient.identity().b2cUserFlows().byB2cIdentityUserFlowId("{b2cIdentityUserFlow-id}").userAttributeAssignments().setOrder().post(setOrderPostRequestBody);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Identity\B2cUserFlows\Item\UserAttributeAssignments\SetOrder\SetOrderPostRequestBody;
use Microsoft\Graph\Beta\Generated\Models\AssignmentOrder;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new SetOrderPostRequestBody();
$newAssignmentOrder = new AssignmentOrder();
$newAssignmentOrder->setOrder(['City', 'extension_GUID_ShoeSize', ]);
$requestBody->setNewAssignmentOrder($newAssignmentOrder);
$graphServiceClient->identity()->b2cUserFlows()->byB2cIdentityUserFlowId('b2cIdentityUserFlow-id')->userAttributeAssignments()->setOrder()->post($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.identity.b2cuserflows.item.userattributeassignments.set_order.set_order_post_request_body import SetOrderPostRequestBody
from msgraph_beta.generated.models.assignment_order import AssignmentOrder
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = SetOrderPostRequestBody(
new_assignment_order = AssignmentOrder(
order = [
"City",
"extension_GUID_ShoeSize",
],
),
)
await graph_client.identity.b2c_user_flows.by_b2c_identity_user_flow_id('b2cIdentityUserFlow-id').user_attribute_assignments.set_order.post(request_body)