Namespace: microsoft.graph
Erstellen Sie ein neues authenticationEventListener-Objekt . Sie können einen der folgenden Untertypen erstellen, die von authenticationEventListener abgeleitet sind.
Diese API ist in den folgenden nationalen Cloudbereitstellungen verfügbar.
| Weltweiter Service |
US Government L4 |
US Government L5 (DOD) |
China, betrieben von 21Vianet |
| ✅ |
✅ |
✅ |
❌ |
Berechtigungen
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) |
EventListener.ReadWrite.All |
Nicht verfügbar. |
| Delegiert (persönliches Microsoft-Konto) |
Nicht unterstützt |
Nicht unterstützt |
| Application |
EventListener.ReadWrite.All |
Nicht verfügbar. |
Wichtig
Für den delegierten Zugriff über Geschäfts-, Schul- oder Unikonten muss dem Administrator eine unterstützte Microsoft Entra Rolle oder eine benutzerdefinierte Rolle zugewiesen werden, die die für diesen Vorgang erforderlichen Berechtigungen gewährt. Dieser Vorgang unterstützt die folgenden integrierten Rollen, die nur die geringsten Berechtigungen bereitstellen:
- Authentifizierungserweiterungsadministrator
- Anwendungsadministrator
HTTP-Anforderung
POST /identity/authenticationEventListeners
Anforderungstext
Geben Sie im Anforderungstext eine JSON-Darstellung des authenticationEventListener-Objekts an.
Sie können die folgenden Eigenschaften angeben, wenn Sie einen authenticationEventListener erstellen. Sie müssen die @odata.type-Eigenschaft angeben, um den Typ von authenticationEventListener anzugeben, der erstellt werden soll. Beispiel: @odata.type": "microsoft.graph.onTokenIssuanceStartListener".
Antwort
Bei erfolgreicher Ausführung gibt die Methode den 201 Created Antwortcode und ein authenticationEventListener-Objekt im Antworttext zurück. Die @odata.type-Eigenschaft gibt den Typ des erstellten Objekts an.
Beispiele
Beispiel 1: Erstellen von authenticationEventListener
Anforderung
Das folgende Beispiel zeigt eine Anfrage.
POST https://graph.microsoft.com/v1.0/identity/authenticationEventListeners
Content-Type: application/json
Content-length: 312
{
"@odata.type": "#microsoft.graph.onTokenIssuanceStartListener",
"conditions": {
"applications": {
"includeApplications": [
{
"appId": "a13d0fc1-04ab-4ede-b215-63de0174cbb4"
}
]
}
},
"handler": {
"@odata.type": "#microsoft.graph.onTokenIssuanceStartCustomExtensionHandler",
"customExtension": {
"id": "6fc5012e-7665-43d6-9708-4370863f4e6e"
}
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new OnTokenIssuanceStartListener
{
OdataType = "#microsoft.graph.onTokenIssuanceStartListener",
Conditions = new AuthenticationConditions
{
Applications = new AuthenticationConditionsApplications
{
IncludeApplications = new List<AuthenticationConditionApplication>
{
new AuthenticationConditionApplication
{
AppId = "a13d0fc1-04ab-4ede-b215-63de0174cbb4",
},
},
},
},
Handler = new OnTokenIssuanceStartCustomExtensionHandler
{
OdataType = "#microsoft.graph.onTokenIssuanceStartCustomExtensionHandler",
CustomExtension = new OnTokenIssuanceStartCustomExtension
{
Id = "6fc5012e-7665-43d6-9708-4370863f4e6e",
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Identity.AuthenticationEventListeners.PostAsync(requestBody);
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
// 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.NewAuthenticationEventListener()
conditions := graphmodels.NewAuthenticationConditions()
applications := graphmodels.NewAuthenticationConditionsApplications()
authenticationConditionApplication := graphmodels.NewAuthenticationConditionApplication()
appId := "a13d0fc1-04ab-4ede-b215-63de0174cbb4"
authenticationConditionApplication.SetAppId(&appId)
includeApplications := []graphmodels.AuthenticationConditionApplicationable {
authenticationConditionApplication,
}
applications.SetIncludeApplications(includeApplications)
conditions.SetApplications(applications)
requestBody.SetConditions(conditions)
handler := graphmodels.NewOnTokenIssuanceStartCustomExtensionHandler()
customExtension := graphmodels.NewOnTokenIssuanceStartCustomExtension()
id := "6fc5012e-7665-43d6-9708-4370863f4e6e"
customExtension.SetId(&id)
handler.SetCustomExtension(customExtension)
requestBody.SetHandler(handler)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
authenticationEventListeners, err := graphClient.Identity().AuthenticationEventListeners().Post(context.Background(), requestBody, nil)
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
OnTokenIssuanceStartListener authenticationEventListener = new OnTokenIssuanceStartListener();
authenticationEventListener.setOdataType("#microsoft.graph.onTokenIssuanceStartListener");
AuthenticationConditions conditions = new AuthenticationConditions();
AuthenticationConditionsApplications applications = new AuthenticationConditionsApplications();
LinkedList<AuthenticationConditionApplication> includeApplications = new LinkedList<AuthenticationConditionApplication>();
AuthenticationConditionApplication authenticationConditionApplication = new AuthenticationConditionApplication();
authenticationConditionApplication.setAppId("a13d0fc1-04ab-4ede-b215-63de0174cbb4");
includeApplications.add(authenticationConditionApplication);
applications.setIncludeApplications(includeApplications);
conditions.setApplications(applications);
authenticationEventListener.setConditions(conditions);
OnTokenIssuanceStartCustomExtensionHandler handler = new OnTokenIssuanceStartCustomExtensionHandler();
handler.setOdataType("#microsoft.graph.onTokenIssuanceStartCustomExtensionHandler");
OnTokenIssuanceStartCustomExtension customExtension = new OnTokenIssuanceStartCustomExtension();
customExtension.setId("6fc5012e-7665-43d6-9708-4370863f4e6e");
handler.setCustomExtension(customExtension);
authenticationEventListener.setHandler(handler);
AuthenticationEventListener result = graphClient.identity().authenticationEventListeners().post(authenticationEventListener);
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
const options = {
authProvider,
};
const client = Client.init(options);
const authenticationEventListener = {
'@odata.type': '#microsoft.graph.onTokenIssuanceStartListener',
conditions: {
applications: {
includeApplications: [
{
appId: 'a13d0fc1-04ab-4ede-b215-63de0174cbb4'
}
]
}
},
handler: {
'@odata.type': '#microsoft.graph.onTokenIssuanceStartCustomExtensionHandler',
customExtension: {
id: '6fc5012e-7665-43d6-9708-4370863f4e6e'
}
}
};
await client.api('/identity/authenticationEventListeners')
.post(authenticationEventListener);
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\OnTokenIssuanceStartListener;
use Microsoft\Graph\Generated\Models\AuthenticationConditions;
use Microsoft\Graph\Generated\Models\AuthenticationConditionsApplications;
use Microsoft\Graph\Generated\Models\AuthenticationConditionApplication;
use Microsoft\Graph\Generated\Models\OnTokenIssuanceStartCustomExtensionHandler;
use Microsoft\Graph\Generated\Models\OnTokenIssuanceStartCustomExtension;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new OnTokenIssuanceStartListener();
$requestBody->setOdataType('#microsoft.graph.onTokenIssuanceStartListener');
$conditions = new AuthenticationConditions();
$conditionsApplications = new AuthenticationConditionsApplications();
$includeApplicationsAuthenticationConditionApplication1 = new AuthenticationConditionApplication();
$includeApplicationsAuthenticationConditionApplication1->setAppId('a13d0fc1-04ab-4ede-b215-63de0174cbb4');
$includeApplicationsArray []= $includeApplicationsAuthenticationConditionApplication1;
$conditionsApplications->setIncludeApplications($includeApplicationsArray);
$conditions->setApplications($conditionsApplications);
$requestBody->setConditions($conditions);
$handler = new OnTokenIssuanceStartCustomExtensionHandler();
$handler->setOdataType('#microsoft.graph.onTokenIssuanceStartCustomExtensionHandler');
$handlerCustomExtension = new OnTokenIssuanceStartCustomExtension();
$handlerCustomExtension->setId('6fc5012e-7665-43d6-9708-4370863f4e6e');
$handler->setCustomExtension($handlerCustomExtension);
$requestBody->setHandler($handler);
$result = $graphServiceClient->identity()->authenticationEventListeners()->post($requestBody)->wait();
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
Import-Module Microsoft.Graph.Identity.SignIns
$params = @{
"@odata.type" = "#microsoft.graph.onTokenIssuanceStartListener"
conditions = @{
applications = @{
includeApplications = @(
@{
appId = "a13d0fc1-04ab-4ede-b215-63de0174cbb4"
}
)
}
}
handler = @{
"@odata.type" = "#microsoft.graph.onTokenIssuanceStartCustomExtensionHandler"
customExtension = @{
id = "6fc5012e-7665-43d6-9708-4370863f4e6e"
}
}
}
New-MgIdentityAuthenticationEventListener -BodyParameter $params
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.on_token_issuance_start_listener import OnTokenIssuanceStartListener
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_token_issuance_start_custom_extension_handler import OnTokenIssuanceStartCustomExtensionHandler
from msgraph.generated.models.on_token_issuance_start_custom_extension import OnTokenIssuanceStartCustomExtension
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = OnTokenIssuanceStartListener(
odata_type = "#microsoft.graph.onTokenIssuanceStartListener",
conditions = AuthenticationConditions(
applications = AuthenticationConditionsApplications(
include_applications = [
AuthenticationConditionApplication(
app_id = "a13d0fc1-04ab-4ede-b215-63de0174cbb4",
),
],
),
),
handler = OnTokenIssuanceStartCustomExtensionHandler(
odata_type = "#microsoft.graph.onTokenIssuanceStartCustomExtensionHandler",
custom_extension = OnTokenIssuanceStartCustomExtension(
id = "6fc5012e-7665-43d6-9708-4370863f4e6e",
),
),
)
result = await graph_client.identity.authentication_event_listeners.post(request_body)
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
Antwort
Das folgende Beispiel zeigt die Antwort.
Hinweis: Das hier gezeigte Antwortobjekt kann zur besseren Lesbarkeit gekürzt werden.
HTTP/1.1 201 Created
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#identity/authenticationEventListeners/$entity",
"@odata.type": "#microsoft.graph.onTokenIssuanceStartListener",
"id": "990d94e5-cc8f-4c4b-97b4-27e2678aac28",
"conditions": {
"applications": {
"includeApplications": [
{
"appId": "a13d0fc1-04ab-4ede-b215-63de0174cbb4"
}
]
}
},
"handler": {
"@odata.type": "#microsoft.graph.onTokenIssuanceStartCustomExtensionHandler",
"customExtension": {
"id": "6fc5012e-7665-43d6-9708-4370863f4e6e"
}
}
}
Beispiel 2: Aktivieren des Betrugsschutzes während der Registrierung mit Arkose Labs
Anforderung
Das folgende Beispiel zeigt eine Anforderung, die Betrugsschutz während der Registrierung mithilfe von Arkose Labs ermöglicht.
POST https://graph.microsoft.com/v1.0/identity/authenticationEventListeners
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.onFraudProtectionLoadStartListener",
"conditions": {
"applications": {
"includeApplications": [
{
"appId": "0001111-aaaa-2222-bbbb-3333cccc4444"
}
]
}
},
"handler": {
"@odata.type":
"#microsoft.graph.onFraudProtectionLoadStartExternalUsersAuthHandler",
"signUp": {
"@odata.type": "#microsoft.graph.fraudProtectionProviderConfiguration",
"fraudProtectionProvider": {
"@odata.type": "#microsoft.graph.arkoseFraudProtectionProvider",
"id": "6fedd01b-0afb-4a07-967f-d1ccbd81102b"
}
}
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new OnFraudProtectionLoadStartListener
{
OdataType = "#microsoft.graph.onFraudProtectionLoadStartListener",
Conditions = new AuthenticationConditions
{
Applications = new AuthenticationConditionsApplications
{
IncludeApplications = new List<AuthenticationConditionApplication>
{
new AuthenticationConditionApplication
{
AppId = "0001111-aaaa-2222-bbbb-3333cccc4444",
},
},
},
},
Handler = new OnFraudProtectionLoadStartExternalUsersAuthHandler
{
OdataType = "#microsoft.graph.onFraudProtectionLoadStartExternalUsersAuthHandler",
SignUp = new FraudProtectionProviderConfiguration
{
OdataType = "#microsoft.graph.fraudProtectionProviderConfiguration",
FraudProtectionProvider = new ArkoseFraudProtectionProvider
{
OdataType = "#microsoft.graph.arkoseFraudProtectionProvider",
Id = "6fedd01b-0afb-4a07-967f-d1ccbd81102b",
},
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Identity.AuthenticationEventListeners.PostAsync(requestBody);
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
// 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.NewAuthenticationEventListener()
conditions := graphmodels.NewAuthenticationConditions()
applications := graphmodels.NewAuthenticationConditionsApplications()
authenticationConditionApplication := graphmodels.NewAuthenticationConditionApplication()
appId := "0001111-aaaa-2222-bbbb-3333cccc4444"
authenticationConditionApplication.SetAppId(&appId)
includeApplications := []graphmodels.AuthenticationConditionApplicationable {
authenticationConditionApplication,
}
applications.SetIncludeApplications(includeApplications)
conditions.SetApplications(applications)
requestBody.SetConditions(conditions)
handler := graphmodels.NewOnFraudProtectionLoadStartExternalUsersAuthHandler()
signUp := graphmodels.NewFraudProtectionProviderConfiguration()
fraudProtectionProvider := graphmodels.NewArkoseFraudProtectionProvider()
id := "6fedd01b-0afb-4a07-967f-d1ccbd81102b"
fraudProtectionProvider.SetId(&id)
signUp.SetFraudProtectionProvider(fraudProtectionProvider)
handler.SetSignUp(signUp)
requestBody.SetHandler(handler)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
authenticationEventListeners, err := graphClient.Identity().AuthenticationEventListeners().Post(context.Background(), requestBody, nil)
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
OnFraudProtectionLoadStartListener authenticationEventListener = new OnFraudProtectionLoadStartListener();
authenticationEventListener.setOdataType("#microsoft.graph.onFraudProtectionLoadStartListener");
AuthenticationConditions conditions = new AuthenticationConditions();
AuthenticationConditionsApplications applications = new AuthenticationConditionsApplications();
LinkedList<AuthenticationConditionApplication> includeApplications = new LinkedList<AuthenticationConditionApplication>();
AuthenticationConditionApplication authenticationConditionApplication = new AuthenticationConditionApplication();
authenticationConditionApplication.setAppId("0001111-aaaa-2222-bbbb-3333cccc4444");
includeApplications.add(authenticationConditionApplication);
applications.setIncludeApplications(includeApplications);
conditions.setApplications(applications);
authenticationEventListener.setConditions(conditions);
OnFraudProtectionLoadStartExternalUsersAuthHandler handler = new OnFraudProtectionLoadStartExternalUsersAuthHandler();
handler.setOdataType("#microsoft.graph.onFraudProtectionLoadStartExternalUsersAuthHandler");
FraudProtectionProviderConfiguration signUp = new FraudProtectionProviderConfiguration();
signUp.setOdataType("#microsoft.graph.fraudProtectionProviderConfiguration");
ArkoseFraudProtectionProvider fraudProtectionProvider = new ArkoseFraudProtectionProvider();
fraudProtectionProvider.setOdataType("#microsoft.graph.arkoseFraudProtectionProvider");
fraudProtectionProvider.setId("6fedd01b-0afb-4a07-967f-d1ccbd81102b");
signUp.setFraudProtectionProvider(fraudProtectionProvider);
handler.setSignUp(signUp);
authenticationEventListener.setHandler(handler);
AuthenticationEventListener result = graphClient.identity().authenticationEventListeners().post(authenticationEventListener);
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
const options = {
authProvider,
};
const client = Client.init(options);
const authenticationEventListener = {
'@odata.type': '#microsoft.graph.onFraudProtectionLoadStartListener',
conditions: {
applications: {
includeApplications: [
{
appId: '0001111-aaaa-2222-bbbb-3333cccc4444'
}
]
}
},
handler: {
'@odata.type':
'#microsoft.graph.onFraudProtectionLoadStartExternalUsersAuthHandler',
signUp: {
'@odata.type': '#microsoft.graph.fraudProtectionProviderConfiguration',
fraudProtectionProvider: {
'@odata.type': '#microsoft.graph.arkoseFraudProtectionProvider',
id: '6fedd01b-0afb-4a07-967f-d1ccbd81102b'
}
}
}
};
await client.api('/identity/authenticationEventListeners')
.post(authenticationEventListener);
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\OnFraudProtectionLoadStartListener;
use Microsoft\Graph\Generated\Models\AuthenticationConditions;
use Microsoft\Graph\Generated\Models\AuthenticationConditionsApplications;
use Microsoft\Graph\Generated\Models\AuthenticationConditionApplication;
use Microsoft\Graph\Generated\Models\OnFraudProtectionLoadStartExternalUsersAuthHandler;
use Microsoft\Graph\Generated\Models\FraudProtectionProviderConfiguration;
use Microsoft\Graph\Generated\Models\ArkoseFraudProtectionProvider;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new OnFraudProtectionLoadStartListener();
$requestBody->setOdataType('#microsoft.graph.onFraudProtectionLoadStartListener');
$conditions = new AuthenticationConditions();
$conditionsApplications = new AuthenticationConditionsApplications();
$includeApplicationsAuthenticationConditionApplication1 = new AuthenticationConditionApplication();
$includeApplicationsAuthenticationConditionApplication1->setAppId('0001111-aaaa-2222-bbbb-3333cccc4444');
$includeApplicationsArray []= $includeApplicationsAuthenticationConditionApplication1;
$conditionsApplications->setIncludeApplications($includeApplicationsArray);
$conditions->setApplications($conditionsApplications);
$requestBody->setConditions($conditions);
$handler = new OnFraudProtectionLoadStartExternalUsersAuthHandler();
$handler->setOdataType('#microsoft.graph.onFraudProtectionLoadStartExternalUsersAuthHandler');
$handlerSignUp = new FraudProtectionProviderConfiguration();
$handlerSignUp->setOdataType('#microsoft.graph.fraudProtectionProviderConfiguration');
$handlerSignUpFraudProtectionProvider = new ArkoseFraudProtectionProvider();
$handlerSignUpFraudProtectionProvider->setOdataType('#microsoft.graph.arkoseFraudProtectionProvider');
$handlerSignUpFraudProtectionProvider->setId('6fedd01b-0afb-4a07-967f-d1ccbd81102b');
$handlerSignUp->setFraudProtectionProvider($handlerSignUpFraudProtectionProvider);
$handler->setSignUp($handlerSignUp);
$requestBody->setHandler($handler);
$result = $graphServiceClient->identity()->authenticationEventListeners()->post($requestBody)->wait();
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
Import-Module Microsoft.Graph.Identity.SignIns
$params = @{
"@odata.type" = "#microsoft.graph.onFraudProtectionLoadStartListener"
conditions = @{
applications = @{
includeApplications = @(
@{
appId = "0001111-aaaa-2222-bbbb-3333cccc4444"
}
)
}
}
handler = @{
"@odata.type" = "#microsoft.graph.onFraudProtectionLoadStartExternalUsersAuthHandler"
signUp = @{
"@odata.type" = "#microsoft.graph.fraudProtectionProviderConfiguration"
fraudProtectionProvider = @{
"@odata.type" = "#microsoft.graph.arkoseFraudProtectionProvider"
id = "6fedd01b-0afb-4a07-967f-d1ccbd81102b"
}
}
}
}
New-MgIdentityAuthenticationEventListener -BodyParameter $params
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.on_fraud_protection_load_start_listener import OnFraudProtectionLoadStartListener
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_fraud_protection_load_start_external_users_auth_handler import OnFraudProtectionLoadStartExternalUsersAuthHandler
from msgraph.generated.models.fraud_protection_provider_configuration import FraudProtectionProviderConfiguration
from msgraph.generated.models.arkose_fraud_protection_provider import ArkoseFraudProtectionProvider
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = OnFraudProtectionLoadStartListener(
odata_type = "#microsoft.graph.onFraudProtectionLoadStartListener",
conditions = AuthenticationConditions(
applications = AuthenticationConditionsApplications(
include_applications = [
AuthenticationConditionApplication(
app_id = "0001111-aaaa-2222-bbbb-3333cccc4444",
),
],
),
),
handler = OnFraudProtectionLoadStartExternalUsersAuthHandler(
odata_type = "#microsoft.graph.onFraudProtectionLoadStartExternalUsersAuthHandler",
sign_up = FraudProtectionProviderConfiguration(
odata_type = "#microsoft.graph.fraudProtectionProviderConfiguration",
fraud_protection_provider = ArkoseFraudProtectionProvider(
odata_type = "#microsoft.graph.arkoseFraudProtectionProvider",
id = "6fedd01b-0afb-4a07-967f-d1ccbd81102b",
),
),
),
)
result = await graph_client.identity.authentication_event_listeners.post(request_body)
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
Antwort
Das folgende Beispiel zeigt die Antwort.
Hinweis: Das hier gezeigte Antwortobjekt kann zur besseren Lesbarkeit gekürzt werden.
HTTP/1.1 201 Created
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#identity/authenticationEventListeners/$entity",
"@odata.type": "#microsoft.graph.onFraudProtectionLoadStartListener",
"id": "49eb23d9-998b-47df-a462-aa12a20ae5fb",
"conditions": {
"applications": {
"includeApplications": [
{
"appId": "0001111-aaaa-2222-bbbb-3333cccc4444"
}
]
}
},
"handler": {
"@odata.type": "#microsoft.graph.onFraudProtectionLoadStartExternalUsersAuthHandler",
"signUp": {
"fraudProtectionProvider": {
"@odata.type": "#microsoft.graph.arkoseFraudProtectionProvider",
"id": "fabe5100-cc02-46c1-bd0e-ce885fe367fd"
}
}
}
}
Beispiel 3: Aktivieren des Betrugsschutzes während der Registrierung mit HUMAN Security
Anforderung
Das folgende Beispiel zeigt eine Anforderung, die Betrugsschutz während der Registrierung mithilfe von HUMAN Security ermöglicht.
POST https://graph.microsoft.com/v1.0/identity/authenticationEventListeners
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.onFraudProtectionLoadStartListener",
"conditions": {
"applications": {
"includeApplications": [
{
"appId": "0001111-aaaa-2222-bbbb-3333cccc4444"
}
]
}
},
"handler": {
"@odata.type":
"#microsoft.graph.onFraudProtectionLoadStartExternalUsersAuthHandler",
"signUp": {
"@odata.type": "#microsoft.graph.fraudProtectionProviderConfiguration",
"fraudProtectionProvider": {
"@odata.type": "#microsoft.graph.humanSecurityFraudProtectionProvider",
"id": "fabe5100-cc02-46c1-bd0e-ce885fe367fd"
}
}
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new OnFraudProtectionLoadStartListener
{
OdataType = "#microsoft.graph.onFraudProtectionLoadStartListener",
Conditions = new AuthenticationConditions
{
Applications = new AuthenticationConditionsApplications
{
IncludeApplications = new List<AuthenticationConditionApplication>
{
new AuthenticationConditionApplication
{
AppId = "0001111-aaaa-2222-bbbb-3333cccc4444",
},
},
},
},
Handler = new OnFraudProtectionLoadStartExternalUsersAuthHandler
{
OdataType = "#microsoft.graph.onFraudProtectionLoadStartExternalUsersAuthHandler",
SignUp = new FraudProtectionProviderConfiguration
{
OdataType = "#microsoft.graph.fraudProtectionProviderConfiguration",
FraudProtectionProvider = new HumanSecurityFraudProtectionProvider
{
OdataType = "#microsoft.graph.humanSecurityFraudProtectionProvider",
Id = "fabe5100-cc02-46c1-bd0e-ce885fe367fd",
},
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Identity.AuthenticationEventListeners.PostAsync(requestBody);
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
// 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.NewAuthenticationEventListener()
conditions := graphmodels.NewAuthenticationConditions()
applications := graphmodels.NewAuthenticationConditionsApplications()
authenticationConditionApplication := graphmodels.NewAuthenticationConditionApplication()
appId := "0001111-aaaa-2222-bbbb-3333cccc4444"
authenticationConditionApplication.SetAppId(&appId)
includeApplications := []graphmodels.AuthenticationConditionApplicationable {
authenticationConditionApplication,
}
applications.SetIncludeApplications(includeApplications)
conditions.SetApplications(applications)
requestBody.SetConditions(conditions)
handler := graphmodels.NewOnFraudProtectionLoadStartExternalUsersAuthHandler()
signUp := graphmodels.NewFraudProtectionProviderConfiguration()
fraudProtectionProvider := graphmodels.NewHumanSecurityFraudProtectionProvider()
id := "fabe5100-cc02-46c1-bd0e-ce885fe367fd"
fraudProtectionProvider.SetId(&id)
signUp.SetFraudProtectionProvider(fraudProtectionProvider)
handler.SetSignUp(signUp)
requestBody.SetHandler(handler)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
authenticationEventListeners, err := graphClient.Identity().AuthenticationEventListeners().Post(context.Background(), requestBody, nil)
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
OnFraudProtectionLoadStartListener authenticationEventListener = new OnFraudProtectionLoadStartListener();
authenticationEventListener.setOdataType("#microsoft.graph.onFraudProtectionLoadStartListener");
AuthenticationConditions conditions = new AuthenticationConditions();
AuthenticationConditionsApplications applications = new AuthenticationConditionsApplications();
LinkedList<AuthenticationConditionApplication> includeApplications = new LinkedList<AuthenticationConditionApplication>();
AuthenticationConditionApplication authenticationConditionApplication = new AuthenticationConditionApplication();
authenticationConditionApplication.setAppId("0001111-aaaa-2222-bbbb-3333cccc4444");
includeApplications.add(authenticationConditionApplication);
applications.setIncludeApplications(includeApplications);
conditions.setApplications(applications);
authenticationEventListener.setConditions(conditions);
OnFraudProtectionLoadStartExternalUsersAuthHandler handler = new OnFraudProtectionLoadStartExternalUsersAuthHandler();
handler.setOdataType("#microsoft.graph.onFraudProtectionLoadStartExternalUsersAuthHandler");
FraudProtectionProviderConfiguration signUp = new FraudProtectionProviderConfiguration();
signUp.setOdataType("#microsoft.graph.fraudProtectionProviderConfiguration");
HumanSecurityFraudProtectionProvider fraudProtectionProvider = new HumanSecurityFraudProtectionProvider();
fraudProtectionProvider.setOdataType("#microsoft.graph.humanSecurityFraudProtectionProvider");
fraudProtectionProvider.setId("fabe5100-cc02-46c1-bd0e-ce885fe367fd");
signUp.setFraudProtectionProvider(fraudProtectionProvider);
handler.setSignUp(signUp);
authenticationEventListener.setHandler(handler);
AuthenticationEventListener result = graphClient.identity().authenticationEventListeners().post(authenticationEventListener);
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
const options = {
authProvider,
};
const client = Client.init(options);
const authenticationEventListener = {
'@odata.type': '#microsoft.graph.onFraudProtectionLoadStartListener',
conditions: {
applications: {
includeApplications: [
{
appId: '0001111-aaaa-2222-bbbb-3333cccc4444'
}
]
}
},
handler: {
'@odata.type':
'#microsoft.graph.onFraudProtectionLoadStartExternalUsersAuthHandler',
signUp: {
'@odata.type': '#microsoft.graph.fraudProtectionProviderConfiguration',
fraudProtectionProvider: {
'@odata.type': '#microsoft.graph.humanSecurityFraudProtectionProvider',
id: 'fabe5100-cc02-46c1-bd0e-ce885fe367fd'
}
}
}
};
await client.api('/identity/authenticationEventListeners')
.post(authenticationEventListener);
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\OnFraudProtectionLoadStartListener;
use Microsoft\Graph\Generated\Models\AuthenticationConditions;
use Microsoft\Graph\Generated\Models\AuthenticationConditionsApplications;
use Microsoft\Graph\Generated\Models\AuthenticationConditionApplication;
use Microsoft\Graph\Generated\Models\OnFraudProtectionLoadStartExternalUsersAuthHandler;
use Microsoft\Graph\Generated\Models\FraudProtectionProviderConfiguration;
use Microsoft\Graph\Generated\Models\HumanSecurityFraudProtectionProvider;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new OnFraudProtectionLoadStartListener();
$requestBody->setOdataType('#microsoft.graph.onFraudProtectionLoadStartListener');
$conditions = new AuthenticationConditions();
$conditionsApplications = new AuthenticationConditionsApplications();
$includeApplicationsAuthenticationConditionApplication1 = new AuthenticationConditionApplication();
$includeApplicationsAuthenticationConditionApplication1->setAppId('0001111-aaaa-2222-bbbb-3333cccc4444');
$includeApplicationsArray []= $includeApplicationsAuthenticationConditionApplication1;
$conditionsApplications->setIncludeApplications($includeApplicationsArray);
$conditions->setApplications($conditionsApplications);
$requestBody->setConditions($conditions);
$handler = new OnFraudProtectionLoadStartExternalUsersAuthHandler();
$handler->setOdataType('#microsoft.graph.onFraudProtectionLoadStartExternalUsersAuthHandler');
$handlerSignUp = new FraudProtectionProviderConfiguration();
$handlerSignUp->setOdataType('#microsoft.graph.fraudProtectionProviderConfiguration');
$handlerSignUpFraudProtectionProvider = new HumanSecurityFraudProtectionProvider();
$handlerSignUpFraudProtectionProvider->setOdataType('#microsoft.graph.humanSecurityFraudProtectionProvider');
$handlerSignUpFraudProtectionProvider->setId('fabe5100-cc02-46c1-bd0e-ce885fe367fd');
$handlerSignUp->setFraudProtectionProvider($handlerSignUpFraudProtectionProvider);
$handler->setSignUp($handlerSignUp);
$requestBody->setHandler($handler);
$result = $graphServiceClient->identity()->authenticationEventListeners()->post($requestBody)->wait();
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
Import-Module Microsoft.Graph.Identity.SignIns
$params = @{
"@odata.type" = "#microsoft.graph.onFraudProtectionLoadStartListener"
conditions = @{
applications = @{
includeApplications = @(
@{
appId = "0001111-aaaa-2222-bbbb-3333cccc4444"
}
)
}
}
handler = @{
"@odata.type" = "#microsoft.graph.onFraudProtectionLoadStartExternalUsersAuthHandler"
signUp = @{
"@odata.type" = "#microsoft.graph.fraudProtectionProviderConfiguration"
fraudProtectionProvider = @{
"@odata.type" = "#microsoft.graph.humanSecurityFraudProtectionProvider"
id = "fabe5100-cc02-46c1-bd0e-ce885fe367fd"
}
}
}
}
New-MgIdentityAuthenticationEventListener -BodyParameter $params
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.on_fraud_protection_load_start_listener import OnFraudProtectionLoadStartListener
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_fraud_protection_load_start_external_users_auth_handler import OnFraudProtectionLoadStartExternalUsersAuthHandler
from msgraph.generated.models.fraud_protection_provider_configuration import FraudProtectionProviderConfiguration
from msgraph.generated.models.human_security_fraud_protection_provider import HumanSecurityFraudProtectionProvider
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = OnFraudProtectionLoadStartListener(
odata_type = "#microsoft.graph.onFraudProtectionLoadStartListener",
conditions = AuthenticationConditions(
applications = AuthenticationConditionsApplications(
include_applications = [
AuthenticationConditionApplication(
app_id = "0001111-aaaa-2222-bbbb-3333cccc4444",
),
],
),
),
handler = OnFraudProtectionLoadStartExternalUsersAuthHandler(
odata_type = "#microsoft.graph.onFraudProtectionLoadStartExternalUsersAuthHandler",
sign_up = FraudProtectionProviderConfiguration(
odata_type = "#microsoft.graph.fraudProtectionProviderConfiguration",
fraud_protection_provider = HumanSecurityFraudProtectionProvider(
odata_type = "#microsoft.graph.humanSecurityFraudProtectionProvider",
id = "fabe5100-cc02-46c1-bd0e-ce885fe367fd",
),
),
),
)
result = await graph_client.identity.authentication_event_listeners.post(request_body)
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
Antwort
Das folgende Beispiel zeigt die Antwort.
Hinweis: Das hier gezeigte Antwortobjekt kann zur besseren Lesbarkeit gekürzt werden.
HTTP/1.1 201 Created
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#identity/authenticationEventListeners/$entity",
"@odata.type": "#microsoft.graph.onFraudProtectionLoadStartListener",
"id": "49eb23d9-998b-47df-a462-aa12a20ae5fb",
"conditions": {
"applications": {
"includeApplications": [
{
"appId": "0001111-aaaa-2222-bbbb-3333cccc4444"
}
]
}
},
"handler": {
"@odata.type": "#microsoft.graph.onFraudProtectionLoadStartExternalUsersAuthHandler",
"signUp": {
"isContinueOnProviderErrorEnabled": false,
"fraudProtectionProvider": {
"@odata.type": "#microsoft.graph.humanSecurityFraudProtectionProvider",
"id": "fabe5100-cc02-46c1-bd0e-ce885fe367fd"
}
}
}
}
Beispiel 4: Erstellen eines onPasswordSubmitListener-Objekts
Anforderung
Das folgende Beispiel zeigt eine Anfrage.
POST https://graph.microsoft.com/v1.0/identity/authenticationEventListeners
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.onPasswordSubmitListener",
"displayName": "JIT migration listener",
"conditions": {
"applications": {
"includeAllApplications": false,
"includeApplications": [
{
"appId": "00011111-aaaa-2222-bbbb-3333cccc4444"
}
]
}
},
"handler": {
"@odata.type": "#microsoft.graph.onPasswordMigrationCustomExtensionHandler",
"migrationPropertyId": "extension_b7b1c57b532f40b8b5ed4b7a7ba67401_requiresMigration",
"customExtension": {
"id": "6fc5012e-7665-43d6-9708-4370863f4e6e"
}
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new OnPasswordSubmitListener
{
OdataType = "#microsoft.graph.onPasswordSubmitListener",
DisplayName = "JIT migration listener",
Conditions = new AuthenticationConditions
{
Applications = new AuthenticationConditionsApplications
{
IncludeApplications = new List<AuthenticationConditionApplication>
{
new AuthenticationConditionApplication
{
AppId = "00011111-aaaa-2222-bbbb-3333cccc4444",
},
},
AdditionalData = new Dictionary<string, object>
{
{
"includeAllApplications" , false
},
},
},
},
Handler = new OnPasswordMigrationCustomExtensionHandler
{
OdataType = "#microsoft.graph.onPasswordMigrationCustomExtensionHandler",
MigrationPropertyId = "extension_b7b1c57b532f40b8b5ed4b7a7ba67401_requiresMigration",
CustomExtension = new OnPasswordSubmitCustomExtension
{
Id = "6fc5012e-7665-43d6-9708-4370863f4e6e",
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Identity.AuthenticationEventListeners.PostAsync(requestBody);
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
// 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.NewAuthenticationEventListener()
displayName := "JIT migration listener"
requestBody.SetDisplayName(&displayName)
conditions := graphmodels.NewAuthenticationConditions()
applications := graphmodels.NewAuthenticationConditionsApplications()
authenticationConditionApplication := graphmodels.NewAuthenticationConditionApplication()
appId := "00011111-aaaa-2222-bbbb-3333cccc4444"
authenticationConditionApplication.SetAppId(&appId)
includeApplications := []graphmodels.AuthenticationConditionApplicationable {
authenticationConditionApplication,
}
applications.SetIncludeApplications(includeApplications)
additionalData := map[string]interface{}{
includeAllApplications := false
applications.SetIncludeAllApplications(&includeAllApplications)
}
applications.SetAdditionalData(additionalData)
conditions.SetApplications(applications)
requestBody.SetConditions(conditions)
handler := graphmodels.NewOnPasswordMigrationCustomExtensionHandler()
migrationPropertyId := "extension_b7b1c57b532f40b8b5ed4b7a7ba67401_requiresMigration"
handler.SetMigrationPropertyId(&migrationPropertyId)
customExtension := graphmodels.NewOnPasswordSubmitCustomExtension()
id := "6fc5012e-7665-43d6-9708-4370863f4e6e"
customExtension.SetId(&id)
handler.SetCustomExtension(customExtension)
requestBody.SetHandler(handler)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
authenticationEventListeners, err := graphClient.Identity().AuthenticationEventListeners().Post(context.Background(), requestBody, nil)
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
OnPasswordSubmitListener authenticationEventListener = new OnPasswordSubmitListener();
authenticationEventListener.setOdataType("#microsoft.graph.onPasswordSubmitListener");
authenticationEventListener.setDisplayName("JIT migration listener");
AuthenticationConditions conditions = new AuthenticationConditions();
AuthenticationConditionsApplications applications = new AuthenticationConditionsApplications();
LinkedList<AuthenticationConditionApplication> includeApplications = new LinkedList<AuthenticationConditionApplication>();
AuthenticationConditionApplication authenticationConditionApplication = new AuthenticationConditionApplication();
authenticationConditionApplication.setAppId("00011111-aaaa-2222-bbbb-3333cccc4444");
includeApplications.add(authenticationConditionApplication);
applications.setIncludeApplications(includeApplications);
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("includeAllApplications", false);
applications.setAdditionalData(additionalData);
conditions.setApplications(applications);
authenticationEventListener.setConditions(conditions);
OnPasswordMigrationCustomExtensionHandler handler = new OnPasswordMigrationCustomExtensionHandler();
handler.setOdataType("#microsoft.graph.onPasswordMigrationCustomExtensionHandler");
handler.setMigrationPropertyId("extension_b7b1c57b532f40b8b5ed4b7a7ba67401_requiresMigration");
OnPasswordSubmitCustomExtension customExtension = new OnPasswordSubmitCustomExtension();
customExtension.setId("6fc5012e-7665-43d6-9708-4370863f4e6e");
handler.setCustomExtension(customExtension);
authenticationEventListener.setHandler(handler);
AuthenticationEventListener result = graphClient.identity().authenticationEventListeners().post(authenticationEventListener);
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
const options = {
authProvider,
};
const client = Client.init(options);
const authenticationEventListener = {
'@odata.type': '#microsoft.graph.onPasswordSubmitListener',
displayName: 'JIT migration listener',
conditions: {
applications: {
includeAllApplications: false,
includeApplications: [
{
appId: '00011111-aaaa-2222-bbbb-3333cccc4444'
}
]
}
},
handler: {
'@odata.type': '#microsoft.graph.onPasswordMigrationCustomExtensionHandler',
migrationPropertyId: 'extension_b7b1c57b532f40b8b5ed4b7a7ba67401_requiresMigration',
customExtension: {
id: '6fc5012e-7665-43d6-9708-4370863f4e6e'
}
}
};
await client.api('/identity/authenticationEventListeners')
.post(authenticationEventListener);
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\OnPasswordSubmitListener;
use Microsoft\Graph\Generated\Models\AuthenticationConditions;
use Microsoft\Graph\Generated\Models\AuthenticationConditionsApplications;
use Microsoft\Graph\Generated\Models\AuthenticationConditionApplication;
use Microsoft\Graph\Generated\Models\OnPasswordMigrationCustomExtensionHandler;
use Microsoft\Graph\Generated\Models\OnPasswordSubmitCustomExtension;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new OnPasswordSubmitListener();
$requestBody->setOdataType('#microsoft.graph.onPasswordSubmitListener');
$requestBody->setDisplayName('JIT migration listener');
$conditions = new AuthenticationConditions();
$conditionsApplications = new AuthenticationConditionsApplications();
$includeApplicationsAuthenticationConditionApplication1 = new AuthenticationConditionApplication();
$includeApplicationsAuthenticationConditionApplication1->setAppId('00011111-aaaa-2222-bbbb-3333cccc4444');
$includeApplicationsArray []= $includeApplicationsAuthenticationConditionApplication1;
$conditionsApplications->setIncludeApplications($includeApplicationsArray);
$additionalData = [
'includeAllApplications' => false,
];
$conditionsApplications->setAdditionalData($additionalData);
$conditions->setApplications($conditionsApplications);
$requestBody->setConditions($conditions);
$handler = new OnPasswordMigrationCustomExtensionHandler();
$handler->setOdataType('#microsoft.graph.onPasswordMigrationCustomExtensionHandler');
$handler->setMigrationPropertyId('extension_b7b1c57b532f40b8b5ed4b7a7ba67401_requiresMigration');
$handlerCustomExtension = new OnPasswordSubmitCustomExtension();
$handlerCustomExtension->setId('6fc5012e-7665-43d6-9708-4370863f4e6e');
$handler->setCustomExtension($handlerCustomExtension);
$requestBody->setHandler($handler);
$result = $graphServiceClient->identity()->authenticationEventListeners()->post($requestBody)->wait();
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
Import-Module Microsoft.Graph.Identity.SignIns
$params = @{
"@odata.type" = "#microsoft.graph.onPasswordSubmitListener"
displayName = "JIT migration listener"
conditions = @{
applications = @{
includeAllApplications = $false
includeApplications = @(
@{
appId = "00011111-aaaa-2222-bbbb-3333cccc4444"
}
)
}
}
handler = @{
"@odata.type" = "#microsoft.graph.onPasswordMigrationCustomExtensionHandler"
migrationPropertyId = "extension_b7b1c57b532f40b8b5ed4b7a7ba67401_requiresMigration"
customExtension = @{
id = "6fc5012e-7665-43d6-9708-4370863f4e6e"
}
}
}
New-MgIdentityAuthenticationEventListener -BodyParameter $params
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.on_password_submit_listener import OnPasswordSubmitListener
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_password_migration_custom_extension_handler import OnPasswordMigrationCustomExtensionHandler
from msgraph.generated.models.on_password_submit_custom_extension import OnPasswordSubmitCustomExtension
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = OnPasswordSubmitListener(
odata_type = "#microsoft.graph.onPasswordSubmitListener",
display_name = "JIT migration listener",
conditions = AuthenticationConditions(
applications = AuthenticationConditionsApplications(
include_applications = [
AuthenticationConditionApplication(
app_id = "00011111-aaaa-2222-bbbb-3333cccc4444",
),
],
additional_data = {
"include_all_applications" : False,
}
),
),
handler = OnPasswordMigrationCustomExtensionHandler(
odata_type = "#microsoft.graph.onPasswordMigrationCustomExtensionHandler",
migration_property_id = "extension_b7b1c57b532f40b8b5ed4b7a7ba67401_requiresMigration",
custom_extension = OnPasswordSubmitCustomExtension(
id = "6fc5012e-7665-43d6-9708-4370863f4e6e",
),
),
)
result = await graph_client.identity.authentication_event_listeners.post(request_body)
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
Antwort
Das folgende Beispiel zeigt die Antwort.
Hinweis: Das hier gezeigte Antwortobjekt kann zur besseren Lesbarkeit gekürzt werden.
HTTP/1.1 201 Created
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#identity/authenticationEventListeners/$entity",
"@odata.type": "#microsoft.graph.onPasswordSubmitListener",
"id": "4a6cb5f0-1234-5678-abcd-ef9012345678",
"displayName": "JIT migration listener",
"authenticationEventsFlowId": null,
"conditions": {
"applications": {
"includeAllApplications": false,
"includeApplications": [
{
"appId": "00011111-aaaa-2222-bbbb-3333cccc4444"
}
]
}
},
"handler": {
"@odata.type": "#microsoft.graph.onPasswordMigrationCustomExtensionHandler",
"migrationPropertyId": "extension_b7b1c57b532f40b8b5ed4b7a7ba67401_requiresMigration",
"configuration": null
}
}
Beispiel 5: Erstellen eines onVerifiedIdClaimValidationListener-Objekts
Anforderung
Das folgende Beispiel zeigt eine Anfrage.
POST https://graph.microsoft.com/v1.0/identity/authenticationEventListeners
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.onVerifiedIdClaimValidationListener",
"displayName": "Verified ID Claim Validation Listener",
"priority": 500,
"conditions": {
"applications": {
"includeAllApplications": false,
"includeApplications": [
{
"appId": "63856651-13d9-4784-9abf-20758d509e19"
}
]
}
},
"authenticationEventsFlowId": "5a8e8f57-82b2-4cbf-b145-3e6e0c154897",
"handler": {
"@odata.type": "#microsoft.graph.onVerifiedIdClaimValidationCustomExtensionHandler",
"configuration": {
"@odata.type": "#microsoft.graph.customExtensionOverwriteConfiguration",
"clientConfiguration": {
"@odata.type": "#microsoft.graph.customExtensionClientConfiguration",
"maximumRetries": 1,
"timeoutInMilliseconds": 2000
},
"behaviorOnError": {
"@odata.type": "#microsoft.graph.customExtensionBehaviorOnError"
}
},
"customExtension": {
"id": "6a0a3429-be77-0aed-951e-1c8aed62bf8a"
}
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
using Microsoft.Kiota.Abstractions.Serialization;
var requestBody = new AuthenticationEventListener
{
OdataType = "#microsoft.graph.onVerifiedIdClaimValidationListener",
DisplayName = "Verified ID Claim Validation Listener",
Conditions = new AuthenticationConditions
{
Applications = new AuthenticationConditionsApplications
{
IncludeApplications = new List<AuthenticationConditionApplication>
{
new AuthenticationConditionApplication
{
AppId = "63856651-13d9-4784-9abf-20758d509e19",
},
},
AdditionalData = new Dictionary<string, object>
{
{
"includeAllApplications" , false
},
},
},
},
AuthenticationEventsFlowId = "5a8e8f57-82b2-4cbf-b145-3e6e0c154897",
AdditionalData = new Dictionary<string, object>
{
{
"priority" , 500
},
{
"handler" , new UntypedObject(new Dictionary<string, UntypedNode>
{
{
"@odata.type", new UntypedString("#microsoft.graph.onVerifiedIdClaimValidationCustomExtensionHandler")
},
{
"configuration", new UntypedObject(new Dictionary<string, UntypedNode>
{
{
"@odata.type", new UntypedString("#microsoft.graph.customExtensionOverwriteConfiguration")
},
{
"clientConfiguration", new UntypedObject(new Dictionary<string, UntypedNode>
{
{
"@odata.type", new UntypedString("#microsoft.graph.customExtensionClientConfiguration")
},
{
"maximumRetries", new UntypedString("1")
},
{
"timeoutInMilliseconds", new UntypedString("2000")
},
})
},
{
"behaviorOnError", new UntypedObject(new Dictionary<string, UntypedNode>
{
{
"@odata.type", new UntypedString("#microsoft.graph.customExtensionBehaviorOnError")
},
})
},
})
},
{
"customExtension", new UntypedObject(new Dictionary<string, UntypedNode>
{
{
"id", new UntypedString("6a0a3429-be77-0aed-951e-1c8aed62bf8a")
},
})
},
})
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Identity.AuthenticationEventListeners.PostAsync(requestBody);
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
// 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.NewAuthenticationEventListener()
displayName := "Verified ID Claim Validation Listener"
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)
additionalData := map[string]interface{}{
includeAllApplications := false
applications.SetIncludeAllApplications(&includeAllApplications)
}
applications.SetAdditionalData(additionalData)
conditions.SetApplications(applications)
requestBody.SetConditions(conditions)
authenticationEventsFlowId := "5a8e8f57-82b2-4cbf-b145-3e6e0c154897"
requestBody.SetAuthenticationEventsFlowId(&authenticationEventsFlowId)
additionalData := map[string]interface{}{
"priority" : int32(500) ,
handler := graph.New()
configuration := graph.New()
clientConfiguration := graph.New()
maximumRetries := int32(1)
clientConfiguration.SetMaximumRetries(&maximumRetries)
timeoutInMilliseconds := int32(2000)
clientConfiguration.SetTimeoutInMilliseconds(&timeoutInMilliseconds)
configuration.SetClientConfiguration(clientConfiguration)
behaviorOnError := graph.New()
configuration.SetBehaviorOnError(behaviorOnError)
handler.SetConfiguration(configuration)
customExtension := graph.New()
id := "6a0a3429-be77-0aed-951e-1c8aed62bf8a"
customExtension.SetId(&id)
handler.SetCustomExtension(customExtension)
requestBody.SetHandler(handler)
}
requestBody.SetAdditionalData(additionalData)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
authenticationEventListeners, err := graphClient.Identity().AuthenticationEventListeners().Post(context.Background(), requestBody, nil)
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
AuthenticationEventListener authenticationEventListener = new AuthenticationEventListener();
authenticationEventListener.setOdataType("#microsoft.graph.onVerifiedIdClaimValidationListener");
authenticationEventListener.setDisplayName("Verified ID Claim Validation Listener");
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);
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("includeAllApplications", false);
applications.setAdditionalData(additionalData);
conditions.setApplications(applications);
authenticationEventListener.setConditions(conditions);
authenticationEventListener.setAuthenticationEventsFlowId("5a8e8f57-82b2-4cbf-b145-3e6e0c154897");
HashMap<String, Object> additionalData1 = new HashMap<String, Object>();
additionalData1.put("priority", 500);
handler = new ();
handler.setOdataType("#microsoft.graph.onVerifiedIdClaimValidationCustomExtensionHandler");
configuration = new ();
configuration.setOdataType("#microsoft.graph.customExtensionOverwriteConfiguration");
clientConfiguration = new ();
clientConfiguration.setOdataType("#microsoft.graph.customExtensionClientConfiguration");
clientConfiguration.setMaximumRetries(1);
clientConfiguration.setTimeoutInMilliseconds(2000);
configuration.setClientConfiguration(clientConfiguration);
behaviorOnError = new ();
behaviorOnError.setOdataType("#microsoft.graph.customExtensionBehaviorOnError");
configuration.setBehaviorOnError(behaviorOnError);
handler.setConfiguration(configuration);
customExtension = new ();
customExtension.setId("6a0a3429-be77-0aed-951e-1c8aed62bf8a");
handler.setCustomExtension(customExtension);
additionalData1.put("handler", handler);
authenticationEventListener.setAdditionalData(additionalData1);
AuthenticationEventListener result = graphClient.identity().authenticationEventListeners().post(authenticationEventListener);
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
const options = {
authProvider,
};
const client = Client.init(options);
const authenticationEventListener = {
'@odata.type': '#microsoft.graph.onVerifiedIdClaimValidationListener',
displayName: 'Verified ID Claim Validation Listener',
priority: 500,
conditions: {
applications: {
includeAllApplications: false,
includeApplications: [
{
appId: '63856651-13d9-4784-9abf-20758d509e19'
}
]
}
},
authenticationEventsFlowId: '5a8e8f57-82b2-4cbf-b145-3e6e0c154897',
handler: {
'@odata.type': '#microsoft.graph.onVerifiedIdClaimValidationCustomExtensionHandler',
configuration: {
'@odata.type': '#microsoft.graph.customExtensionOverwriteConfiguration',
clientConfiguration: {
'@odata.type': '#microsoft.graph.customExtensionClientConfiguration',
maximumRetries: 1,
timeoutInMilliseconds: 2000
},
behaviorOnError: {
'@odata.type': '#microsoft.graph.customExtensionBehaviorOnError'
}
},
customExtension: {
id: '6a0a3429-be77-0aed-951e-1c8aed62bf8a'
}
}
};
await client.api('/identity/authenticationEventListeners')
.post(authenticationEventListener);
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\AuthenticationEventListener;
use Microsoft\Graph\Generated\Models\AuthenticationConditions;
use Microsoft\Graph\Generated\Models\AuthenticationConditionsApplications;
use Microsoft\Graph\Generated\Models\AuthenticationConditionApplication;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new AuthenticationEventListener();
$requestBody->setOdataType('#microsoft.graph.onVerifiedIdClaimValidationListener');
$requestBody->setDisplayName('Verified ID Claim Validation Listener');
$conditions = new AuthenticationConditions();
$conditionsApplications = new AuthenticationConditionsApplications();
$includeApplicationsAuthenticationConditionApplication1 = new AuthenticationConditionApplication();
$includeApplicationsAuthenticationConditionApplication1->setAppId('63856651-13d9-4784-9abf-20758d509e19');
$includeApplicationsArray []= $includeApplicationsAuthenticationConditionApplication1;
$conditionsApplications->setIncludeApplications($includeApplicationsArray);
$additionalData = [
'includeAllApplications' => false,
];
$conditionsApplications->setAdditionalData($additionalData);
$conditions->setApplications($conditionsApplications);
$requestBody->setConditions($conditions);
$requestBody->setAuthenticationEventsFlowId('5a8e8f57-82b2-4cbf-b145-3e6e0c154897');
$additionalData = [
'priority' => 500,
'handler' => [
'@odata.type' => '#microsoft.graph.onVerifiedIdClaimValidationCustomExtensionHandler',
'configuration' => [
'@odata.type' => '#microsoft.graph.customExtensionOverwriteConfiguration',
'clientConfiguration' => [
'@odata.type' => '#microsoft.graph.customExtensionClientConfiguration',
'maximumRetries' => 1,
'timeoutInMilliseconds' => 2000,
],
'behaviorOnError' => [
'@odata.type' => '#microsoft.graph.customExtensionBehaviorOnError',
],
],
'customExtension' => [
'id' => '6a0a3429-be77-0aed-951e-1c8aed62bf8a',
],
],
];
$requestBody->setAdditionalData($additionalData);
$result = $graphServiceClient->identity()->authenticationEventListeners()->post($requestBody)->wait();
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
Import-Module Microsoft.Graph.Identity.SignIns
$params = @{
"@odata.type" = "#microsoft.graph.onVerifiedIdClaimValidationListener"
displayName = "Verified ID Claim Validation Listener"
priority =
conditions = @{
applications = @{
includeAllApplications = $false
includeApplications = @(
@{
appId = "63856651-13d9-4784-9abf-20758d509e19"
}
)
}
}
authenticationEventsFlowId = "5a8e8f57-82b2-4cbf-b145-3e6e0c154897"
handler = @{
"@odata.type" = "#microsoft.graph.onVerifiedIdClaimValidationCustomExtensionHandler"
configuration = @{
"@odata.type" = "#microsoft.graph.customExtensionOverwriteConfiguration"
clientConfiguration = @{
"@odata.type" = "#microsoft.graph.customExtensionClientConfiguration"
maximumRetries =
timeoutInMilliseconds =
}
behaviorOnError = @{
"@odata.type" = "#microsoft.graph.customExtensionBehaviorOnError"
}
}
customExtension = @{
id = "6a0a3429-be77-0aed-951e-1c8aed62bf8a"
}
}
}
New-MgIdentityAuthenticationEventListener -BodyParameter $params
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.authentication_event_listener import AuthenticationEventListener
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
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = AuthenticationEventListener(
odata_type = "#microsoft.graph.onVerifiedIdClaimValidationListener",
display_name = "Verified ID Claim Validation Listener",
conditions = AuthenticationConditions(
applications = AuthenticationConditionsApplications(
include_applications = [
AuthenticationConditionApplication(
app_id = "63856651-13d9-4784-9abf-20758d509e19",
),
],
additional_data = {
"include_all_applications" : False,
}
),
),
authentication_events_flow_id = "5a8e8f57-82b2-4cbf-b145-3e6e0c154897",
additional_data = {
"priority" : 500,
"handler" : {
"@odata_type" : "#microsoft.graph.onVerifiedIdClaimValidationCustomExtensionHandler",
"configuration" : {
"@odata_type" : "#microsoft.graph.customExtensionOverwriteConfiguration",
"client_configuration" : {
"@odata_type" : "#microsoft.graph.customExtensionClientConfiguration",
"maximum_retries" : 1,
"timeout_in_milliseconds" : 2000,
},
"behavior_on_error" : {
"@odata_type" : "#microsoft.graph.customExtensionBehaviorOnError",
},
},
"custom_extension" : {
"id" : "6a0a3429-be77-0aed-951e-1c8aed62bf8a",
},
},
}
)
result = await graph_client.identity.authentication_event_listeners.post(request_body)
Einzelheiten darüber, wie Sie das SDK zu Ihrem Projekt hinzufügen und eine authProvider-Instanz erstellen, finden Sie in der SDK-Dokumentation.
Antwort
Das folgende Beispiel zeigt die Antwort.
Hinweis: Das hier gezeigte Antwortobjekt kann zur besseren Lesbarkeit gekürzt werden.
HTTP/1.1 201 Created
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#identity/authenticationEventListeners/$entity",
"@odata.type": "#microsoft.graph.onVerifiedIdClaimValidationListener",
"id": "6a7455ef-0906-bbc3-f902-0f9ab8903082",
"displayName": "Verified ID Claim Validation Listener",
"priority": 500,
"conditions": {
"applications": {
"includeAllApplications": false,
"includeApplications": [
{
"appId": "63856651-13d9-4784-9abf-20758d509e19"
}
]
}
},
"authenticationEventsFlowId": "5a8e8f57-82b2-4cbf-b145-3e6e0c154897",
"handler": {
"@odata.type": "#microsoft.graph.onVerifiedIdClaimValidationCustomExtensionHandler",
"configuration": {
"@odata.type": "#microsoft.graph.customExtensionOverwriteConfiguration",
"clientConfiguration": {
"@odata.type": "#microsoft.graph.customExtensionClientConfiguration",
"maximumRetries": 1,
"timeoutInMilliseconds": 2000
},
"behaviorOnError": {
"@odata.type": "#microsoft.graph.customExtensionBehaviorOnError"
}
},
"customExtension": {
"id": "6a0a3429-be77-0aed-951e-1c8aed62bf8a"
}
}
}