Espace de noms: microsoft.graph
Importante
Les API sous la version /beta dans Microsoft Graph sont susceptibles d’être modifiées. L’utilisation de ces API dans des applications de production n’est pas prise en charge. Pour déterminer si une API est disponible dans v1.0, utilisez le sélecteur Version .
Ajouter ou lier une application à un flux utilisateur d’inscription en libre-service des identités externes représenté par un objet externalUsersSelfServiceSignupEventsFlow . Cela permet d’activer l’expérience d’authentification définie par le flux d’utilisateur pour l’application. Une application ne peut être liée qu’à un seul flux utilisateur. L’application doit avoir un principal de service associé dans le client.
Cette API est disponible dans les déploiements cloud nationaux suivants.
| Service global |
Gouvernement américain L4 |
Gouvernement américain L5 (DOD) |
Chine exploitée par 21Vianet |
| ✅ |
❌ |
❌ |
✅ |
Autorisations
Choisissez l’autorisation ou les autorisations marquées comme étant les moins privilégiées pour cette API. Utilisez une ou plusieurs autorisations privilégiées uniquement si votre application en a besoin. Pour plus d’informations sur les autorisations déléguées et d’application, voir Types d’autorisations. Pour en savoir plus sur ces autorisations, consultez la référence des autorisations.
| Type d’autorisation |
Autorisations les moins privilégiées |
Autorisations à privilèges plus élevés |
| Déléguée (compte professionnel ou scolaire) |
EventListener.ReadWrite.All |
Non disponible. |
| Déléguée (compte Microsoft personnel) |
Non prise en charge. |
Non prise en charge. |
| Application |
EventListener.ReadWrite.All |
Non disponible. |
Importante
Pour l’accès délégué à l’aide de comptes professionnels ou scolaires, l’utilisateur connecté doit être propriétaire ou membre du groupe ou disposer d’un rôle Microsoft Entra pris en charge ou d’un rôle personnalisé qui accorde les autorisations requises pour cette opération.
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/authenticationEventsFlows/{authenticationEventsFlow-id}/conditions/applications/includeApplications
Corps de la demande
Dans le corps de la demande, fournissez une représentation JSON de l’appId du principal du service à associer au flux utilisateur.
Réponse
En cas de réussite, cette méthode renvoie un 201 Created code de réponse et un nouvel objet authenticationConditionApplication dans le corps de la réponse. En cas d’échec, une 4xx erreur est renvoyée avec des détails spécifiques.
Exemples
Demande
L’exemple suivant illustre une demande.
POST https://graph.microsoft.com/beta/identity/authenticationEventsFlows/0313cc37-d421-421d-857b-87804d61e33e/conditions/applications/includeApplications
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.authenticationConditionApplication",
"appId": "63856651-13d9-4784-9abf-20758d509e19"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new AuthenticationConditionApplication
{
OdataType = "#microsoft.graph.authenticationConditionApplication",
AppId = "63856651-13d9-4784-9abf-20758d509e19",
};
// 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}"].Conditions.Applications.IncludeApplications.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"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewAuthenticationConditionApplication()
appId := "63856651-13d9-4784-9abf-20758d509e19"
requestBody.SetAppId(&appId)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
includeApplications, err := graphClient.Identity().AuthenticationEventsFlows().ByAuthenticationEventsFlowId("authenticationEventsFlow-id").Conditions().Applications().IncludeApplications().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
AuthenticationConditionApplication authenticationConditionApplication = new AuthenticationConditionApplication();
authenticationConditionApplication.setOdataType("#microsoft.graph.authenticationConditionApplication");
authenticationConditionApplication.setAppId("63856651-13d9-4784-9abf-20758d509e19");
AuthenticationConditionApplication result = graphClient.identity().authenticationEventsFlows().byAuthenticationEventsFlowId("{authenticationEventsFlow-id}").conditions().applications().includeApplications().post(authenticationConditionApplication);
const options = {
authProvider,
};
const client = Client.init(options);
const authenticationConditionApplication = {
'@odata.type': '#microsoft.graph.authenticationConditionApplication',
appId: '63856651-13d9-4784-9abf-20758d509e19'
};
await client.api('/identity/authenticationEventsFlows/0313cc37-d421-421d-857b-87804d61e33e/conditions/applications/includeApplications')
.version('beta')
.post(authenticationConditionApplication);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\AuthenticationConditionApplication;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new AuthenticationConditionApplication();
$requestBody->setOdataType('#microsoft.graph.authenticationConditionApplication');
$requestBody->setAppId('63856651-13d9-4784-9abf-20758d509e19');
$result = $graphServiceClient->identity()->authenticationEventsFlows()->byAuthenticationEventsFlowId('authenticationEventsFlow-id')->conditions()->applications()->includeApplications()->post($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Identity.SignIns
$params = @{
"@odata.type" = "#microsoft.graph.authenticationConditionApplication"
appId = "63856651-13d9-4784-9abf-20758d509e19"
}
New-MgBetaIdentityAuthenticationEventFlowIncludeApplication -AuthenticationEventsFlowId $authenticationEventsFlowId -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.authentication_condition_application import AuthenticationConditionApplication
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = AuthenticationConditionApplication(
odata_type = "#microsoft.graph.authenticationConditionApplication",
app_id = "63856651-13d9-4784-9abf-20758d509e19",
)
result = await graph_client.identity.authentication_events_flows.by_authentication_events_flow_id('authenticationEventsFlow-id').conditions.applications.include_applications.post(request_body)
Réponse
L’exemple suivant illustre la réponse.
HTTP/1.1 201 Created
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#identity/authenticationEventsFlows('0313cc37-d421-421d-857b-87804d61e33e')/conditions/applications/includeApplications/$entity",
"appId": "63856651-13d9-4784-9abf-20758d509e19"
}