Wählen Sie die Berechtigungen aus, die für diese API als am wenigsten privilegiert markiert sind. Verwenden Sie eine höhere Berechtigung oder Berechtigungen nur, wenn Ihre App dies erfordert. Ausführliche Informationen zu delegierten Berechtigungen und Anwendungsberechtigungen finden Sie unter Berechtigungstypen. Weitere Informationen zu diesen Berechtigungen finden Sie in der Berechtigungsreferenz.
Berechtigungstyp
Berechtigungen mit den geringsten Berechtigungen
Berechtigungen mit höheren Berechtigungen
Delegiert (Geschäfts-, Schul- oder Unikonto)
IdentityUserFlow.ReadWrite.All
Nicht verfügbar.
Delegiert (persönliches Microsoft-Konto)
Nicht unterstützt
Nicht unterstützt
Anwendung
IdentityUserFlow.ReadWrite.All
Nicht verfügbar.
Wichtig
In delegierten Szenarien mit Geschäfts-, Schul- oder Unikonten muss dem angemeldeten Benutzer eine unterstützte Microsoft Entra Rolle oder eine benutzerdefinierte Rolle mit einer unterstützten Rollenberechtigung zugewiesen werden.
External ID Benutzerflowadministrator ist die Rolle mit den geringsten Berechtigungen, die für diesen Vorgang unterstützt wird.
Optional. Konfiguration zur Aktivierung eines API-Connectors zur Verwendung als Teil des Benutzerflusses.
Antwort
Bei erfolgreicher Ausführung gibt die Methode einen 201 Created Antwortcode und einen Location-Header mit einem URI für das für diese Anforderung erstellte b2xIdentityUserFlow-Objekt zurück, wobei dem Namen das B2X_1 Präfix hinzugefügt wurde. Wenn der Fehler nicht erfolgreich ist, wird ein 4xx Fehler mit bestimmten Details zurückgegeben.
Beispiele
Beispiel 1: Erstellen eines Benutzerflows mit den Standardwerten
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new B2xIdentityUserFlow
{
Id = "Partner",
UserFlowType = UserFlowType.SignUpOrSignIn,
UserFlowTypeVersion = 1f,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Identity.B2xUserFlows.PostAsync(requestBody);
// 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.NewB2xIdentityUserFlow()
id := "Partner"
requestBody.SetId(&id)
userFlowType := graphmodels.SIGNUPORSIGNIN_USERFLOWTYPE
requestBody.SetUserFlowType(&userFlowType)
userFlowTypeVersion := float32(1)
requestBody.SetUserFlowTypeVersion(&userFlowTypeVersion)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
b2xUserFlows, err := graphClient.Identity().B2xUserFlows().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
B2xIdentityUserFlow b2xIdentityUserFlow = new B2xIdentityUserFlow();
b2xIdentityUserFlow.setId("Partner");
b2xIdentityUserFlow.setUserFlowType(UserFlowType.SignUpOrSignIn);
b2xIdentityUserFlow.setUserFlowTypeVersion(1f);
B2xIdentityUserFlow result = graphClient.identity().b2xUserFlows().post(b2xIdentityUserFlow);
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\B2xIdentityUserFlow;
use Microsoft\Graph\Generated\Models\UserFlowType;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new B2xIdentityUserFlow();
$requestBody->setId('Partner');
$requestBody->setUserFlowType(new UserFlowType('signUpOrSignIn'));
$requestBody->setUserFlowTypeVersion(1);
$result = $graphServiceClient->identity()->b2xUserFlows()->post($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.b2x_identity_user_flow import B2xIdentityUserFlow
from msgraph.generated.models.user_flow_type import UserFlowType
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = B2xIdentityUserFlow(
id = "Partner",
user_flow_type = UserFlowType.SignUpOrSignIn,
user_flow_type_version = 1,
)
result = await graph_client.identity.b2x_user_flows.post(request_body)
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new B2xIdentityUserFlow
{
Id = "Partner",
UserFlowType = UserFlowType.SignUpOrSignIn,
UserFlowTypeVersion = 1f,
IdentityProviders = new List<IdentityProvider>
{
new IdentityProvider
{
Id = "Facebook-OAuth",
Type = "Facebook",
Name = "Facebook",
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Identity.B2xUserFlows.PostAsync(requestBody);
// 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.NewB2xIdentityUserFlow()
id := "Partner"
requestBody.SetId(&id)
userFlowType := graphmodels.SIGNUPORSIGNIN_USERFLOWTYPE
requestBody.SetUserFlowType(&userFlowType)
userFlowTypeVersion := float32(1)
requestBody.SetUserFlowTypeVersion(&userFlowTypeVersion)
identityProvider := graphmodels.NewIdentityProvider()
id := "Facebook-OAuth"
identityProvider.SetId(&id)
type := "Facebook"
identityProvider.SetType(&type)
name := "Facebook"
identityProvider.SetName(&name)
identityProviders := []graphmodels.IdentityProviderable {
identityProvider,
}
requestBody.SetIdentityProviders(identityProviders)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
b2xUserFlows, err := graphClient.Identity().B2xUserFlows().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
B2xIdentityUserFlow b2xIdentityUserFlow = new B2xIdentityUserFlow();
b2xIdentityUserFlow.setId("Partner");
b2xIdentityUserFlow.setUserFlowType(UserFlowType.SignUpOrSignIn);
b2xIdentityUserFlow.setUserFlowTypeVersion(1f);
LinkedList<IdentityProvider> identityProviders = new LinkedList<IdentityProvider>();
IdentityProvider identityProvider = new IdentityProvider();
identityProvider.setId("Facebook-OAuth");
identityProvider.setType("Facebook");
identityProvider.setName("Facebook");
identityProviders.add(identityProvider);
b2xIdentityUserFlow.setIdentityProviders(identityProviders);
B2xIdentityUserFlow result = graphClient.identity().b2xUserFlows().post(b2xIdentityUserFlow);
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.b2x_identity_user_flow import B2xIdentityUserFlow
from msgraph.generated.models.user_flow_type import UserFlowType
from msgraph.generated.models.identity_provider import IdentityProvider
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = B2xIdentityUserFlow(
id = "Partner",
user_flow_type = UserFlowType.SignUpOrSignIn,
user_flow_type_version = 1,
identity_providers = [
IdentityProvider(
id = "Facebook-OAuth",
type = "Facebook",
name = "Facebook",
),
],
)
result = await graph_client.identity.b2x_user_flows.post(request_body)
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new B2xIdentityUserFlow
{
Id = "UserFlowWithAPIConnector",
UserFlowType = UserFlowType.SignUpOrSignIn,
UserFlowTypeVersion = 1f,
ApiConnectorConfiguration = new UserFlowApiConnectorConfiguration
{
PostFederationSignup = new IdentityApiConnector
{
AdditionalData = new Dictionary<string, object>
{
{
"@odata.id" , "https://graph.microsoft.com/v1/identity/apiConnectors/{id}"
},
},
},
PostAttributeCollection = new IdentityApiConnector
{
AdditionalData = new Dictionary<string, object>
{
{
"@odata.id" , "https://graph.microsoft.com/v1/identity/apiConnectors/{id}"
},
},
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Identity.B2xUserFlows.PostAsync(requestBody);
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
B2xIdentityUserFlow b2xIdentityUserFlow = new B2xIdentityUserFlow();
b2xIdentityUserFlow.setId("UserFlowWithAPIConnector");
b2xIdentityUserFlow.setUserFlowType(UserFlowType.SignUpOrSignIn);
b2xIdentityUserFlow.setUserFlowTypeVersion(1f);
UserFlowApiConnectorConfiguration apiConnectorConfiguration = new UserFlowApiConnectorConfiguration();
IdentityApiConnector postFederationSignup = new IdentityApiConnector();
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("@odata.id", "https://graph.microsoft.com/v1/identity/apiConnectors/{id}");
postFederationSignup.setAdditionalData(additionalData);
apiConnectorConfiguration.setPostFederationSignup(postFederationSignup);
IdentityApiConnector postAttributeCollection = new IdentityApiConnector();
HashMap<String, Object> additionalData1 = new HashMap<String, Object>();
additionalData1.put("@odata.id", "https://graph.microsoft.com/v1/identity/apiConnectors/{id}");
postAttributeCollection.setAdditionalData(additionalData1);
apiConnectorConfiguration.setPostAttributeCollection(postAttributeCollection);
b2xIdentityUserFlow.setApiConnectorConfiguration(apiConnectorConfiguration);
B2xIdentityUserFlow result = graphClient.identity().b2xUserFlows().post(b2xIdentityUserFlow);
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.b2x_identity_user_flow import B2xIdentityUserFlow
from msgraph.generated.models.user_flow_type import UserFlowType
from msgraph.generated.models.user_flow_api_connector_configuration import UserFlowApiConnectorConfiguration
from msgraph.generated.models.identity_api_connector import IdentityApiConnector
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = B2xIdentityUserFlow(
id = "UserFlowWithAPIConnector",
user_flow_type = UserFlowType.SignUpOrSignIn,
user_flow_type_version = 1,
api_connector_configuration = UserFlowApiConnectorConfiguration(
post_federation_signup = IdentityApiConnector(
additional_data = {
"@odata_id" : "https://graph.microsoft.com/v1/identity/apiConnectors/{id}",
}
),
post_attribute_collection = IdentityApiConnector(
additional_data = {
"@odata_id" : "https://graph.microsoft.com/v1/identity/apiConnectors/{id}",
}
),
),
)
result = await graph_client.identity.b2x_user_flows.post(request_body)
Hinweis: Das hier gezeigte Antwortobjekt kann zur besseren Lesbarkeit gekürzt werden.
Anmerkung: Die apiConnectorConfiguration -Eigenschaft gibt immer einen "{}"-Wert zurück. Verwenden Sie diese API, um den vollständigen Wert mit den Navigationseigenschaften anzuzeigen.