Mit der authenticationBehaviors-Eigenschaft des Anwendungsobjekts können Sie Breaking Change-Verhaltensweisen im Zusammenhang mit der Tokenausstellung konfigurieren. Anwendungen können neue Breaking Changes übernehmen, indem sie ein Verhalten aktivieren oder vorhandenes Verhalten weiterhin verwenden, indem sie es deaktivieren.
Sie können die folgenden Verhaltensweisen konfigurieren:
Hinweis
Die authenticationBehaviors-Eigenschaft des Anwendungsobjekts ist derzeit nur in beta verfügbar.
Lesen der AuthenticationBehaviors-Einstellung für eine Anwendung
Die authenticationBehaviors-Eigenschaft wird nur bei $select Anforderungen zurückgegeben.
Führen Sie die folgende Beispielanforderung aus, um die Eigenschaft und andere angegebene Eigenschaften aller Apps im Mandanten zu lesen. Die Anforderung gibt einen 200 OK Antwortcode und eine JSON-Darstellung des Anwendungsobjekts zurück, die nur die ausgewählten Eigenschaften anzeigt.
GET https://graph.microsoft.com/beta/applications?$select=id,displayName,appId,authenticationBehaviors
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Applications.GetAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Select = new string []{ "id","displayName","appId","authenticationBehaviors" };
});
In der SDK-Dokumentation finden Sie ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider -Instanz.
// 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"
graphapplications "github.com/microsoftgraph/msgraph-beta-sdk-go/applications"
//other-imports
)
requestParameters := &graphapplications.ApplicationsRequestBuilderGetQueryParameters{
Select: [] string {"id","displayName","appId","authenticationBehaviors"},
}
configuration := &graphapplications.ApplicationsRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
applications, err := graphClient.Applications().Get(context.Background(), configuration)
In der SDK-Dokumentation finden Sie ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider -Instanz.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
ApplicationCollectionResponse result = graphClient.applications().get(requestConfiguration -> {
requestConfiguration.queryParameters.select = new String []{"id", "displayName", "appId", "authenticationBehaviors"};
});
In der SDK-Dokumentation finden Sie ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider -Instanz.
const options = {
authProvider,
};
const client = Client.init(options);
let applications = await client.api('/applications')
.version('beta')
.select('id,displayName,appId,authenticationBehaviors')
.get();
In der SDK-Dokumentation finden Sie ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider -Instanz.
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Applications\ApplicationsRequestBuilderGetRequestConfiguration;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestConfiguration = new ApplicationsRequestBuilderGetRequestConfiguration();
$queryParameters = ApplicationsRequestBuilderGetRequestConfiguration::createQueryParameters();
$queryParameters->select = ["id","displayName","appId","authenticationBehaviors"];
$requestConfiguration->queryParameters = $queryParameters;
$result = $graphServiceClient->applications()->get($requestConfiguration)->wait();
In der SDK-Dokumentation finden Sie ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider -Instanz.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.applications.applications_request_builder import ApplicationsRequestBuilder
from kiota_abstractions.base_request_configuration import RequestConfiguration
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
query_params = ApplicationsRequestBuilder.ApplicationsRequestBuilderGetQueryParameters(
select = ["id","displayName","appId","authenticationBehaviors"],
)
request_configuration = RequestConfiguration(
query_parameters = query_params,
)
result = await graph_client.applications.get(request_configuration = request_configuration)
In der SDK-Dokumentation finden Sie ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider -Instanz.
Um nur die authenticationBehaviors-Eigenschaft für eine einzelne App zu lesen, führen Sie die folgende Beispielanforderung aus.
GET https://graph.microsoft.com/beta/applications/03ef14b0-ca33-4840-8f4f-d6e91916010e/authenticationBehaviors
const options = {
authProvider,
};
const client = Client.init(options);
let authenticationBehaviors = await client.api('/applications/03ef14b0-ca33-4840-8f4f-d6e91916010e/authenticationBehaviors')
.version('beta')
.get();
In der SDK-Dokumentation finden Sie ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider -Instanz.
Sie können die appId-Eigenschaft auch wie folgt verwenden:
GET https://graph.microsoft.com/beta/applications(appId='37bf1fd4-78b0-4fea-ac2d-6c82829e9365')/authenticationBehaviors
Verhindern der Ausstellung von E-Mail-Ansprüchen bei nicht überprüften Domänenbesitzern
Wie in der Microsoft-Sicherheitsempfehlung Potenzielles Risiko der Rechteausweitung in Microsoft Entra-Anwendungen beschrieben, sollten Apps den E-Mail-Anspruch niemals zu Autorisierungszwecken verwenden. Wenn Ihre Anwendung den E-Mail-Anspruch zu Autorisierungs- oder primären Benutzeridentifikationszwecken verwendet, unterliegt sie Angriffen auf Konto- und Rechteausweitung. Dieses Risiko eines nicht autorisierten Zugriffs wird insbesondere in den folgenden Szenarien identifiziert:
- Wenn das E-Mail-Attribut des Benutzerobjekts eine E-Mail-Adresse mit einem nicht überprüften Domänenbesitzer enthält
- Für mehrinstanzenfähige Apps, bei denen ein Benutzer aus einem Mandanten seine Berechtigungen für den Zugriff auf Ressourcen von einem anderen Mandanten durch Änderung seines E-Mail-Attributs eskalieren könnte
Weitere Informationen zum Identifizieren dieser Fälle in Ihrem Mandanten finden Sie unter Migrieren von der Verwendung von E-Mail-Ansprüchen für die Benutzeridentifikation oder Autorisierung.
Heute besteht das Standardverhalten darin, E-Mail-Adressen mit nicht überprüften Domänenbesitzern in Ansprüchen zu entfernen, mit Ausnahme von Einzelmandanten-Apps und für mehrinstanzenfähige Apps mit vorheriger Anmeldeaktivität mit nicht überprüften E-Mails. Wenn Ihre App in eine dieser Ausnahmen fällt und Sie nicht überprüfte E-Mail-Adressen entfernen möchten, legen Sie die removeUnverifiedEmailClaim-Eigenschaft von authenticationBehaviors auf fest true , wie in den folgenden Beispielen gezeigt. Die Anforderung gibt einen 204 No Content Antwortcode zurück.
Entfernen von E-Mail-Adressen mit nicht überprüften Domänenbesitzern aus Ansprüchen
Option 1
Dieses Muster zum Angeben der Eigenschaft in der Anforderungs-URL ermöglicht es Ihnen , nur die angegebene Eigenschaft in der Anforderung zu aktualisieren.
PATCH https://graph.microsoft.com/beta/applications/03ef14b0-ca33-4840-8f4f-d6e91916010e/authenticationBehaviors
Content-Type: application/json
{
"removeUnverifiedEmailClaim": true
}
const options = {
authProvider,
};
const client = Client.init(options);
const authenticationBehaviors = {
removeUnverifiedEmailClaim: true
};
await client.api('/applications/03ef14b0-ca33-4840-8f4f-d6e91916010e/authenticationBehaviors')
.version('beta')
.update(authenticationBehaviors);
In der SDK-Dokumentation finden Sie ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider -Instanz.
Option 2
Mit diesem Muster zum Angeben der Eigenschaft im Anforderungstext können Sie andere Peereigenschaften in derselben Anforderung aktualisieren.
PATCH https://graph.microsoft.com/beta/applications/03ef14b0-ca33-4840-8f4f-d6e91916010e
Content-Type: application/json
{
"authenticationBehaviors": {
"removeUnverifiedEmailClaim": true
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new Application
{
AuthenticationBehaviors = new AuthenticationBehaviors
{
RemoveUnverifiedEmailClaim = true,
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Applications["{application-id}"].PatchAsync(requestBody);
In der SDK-Dokumentation finden Sie ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider -Instanz.
// 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.NewApplication()
authenticationBehaviors := graphmodels.NewAuthenticationBehaviors()
removeUnverifiedEmailClaim := true
authenticationBehaviors.SetRemoveUnverifiedEmailClaim(&removeUnverifiedEmailClaim)
requestBody.SetAuthenticationBehaviors(authenticationBehaviors)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
applications, err := graphClient.Applications().ByApplicationId("application-id").Patch(context.Background(), requestBody, nil)
In der SDK-Dokumentation finden Sie ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider -Instanz.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
Application application = new Application();
AuthenticationBehaviors authenticationBehaviors = new AuthenticationBehaviors();
authenticationBehaviors.setRemoveUnverifiedEmailClaim(true);
application.setAuthenticationBehaviors(authenticationBehaviors);
Application result = graphClient.applications().byApplicationId("{application-id}").patch(application);
In der SDK-Dokumentation finden Sie ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider -Instanz.
const options = {
authProvider,
};
const client = Client.init(options);
const application = {
authenticationBehaviors: {
removeUnverifiedEmailClaim: true
}
};
await client.api('/applications/03ef14b0-ca33-4840-8f4f-d6e91916010e')
.version('beta')
.update(application);
In der SDK-Dokumentation finden Sie ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider -Instanz.
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\Application;
use Microsoft\Graph\Beta\Generated\Models\AuthenticationBehaviors;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new Application();
$authenticationBehaviors = new AuthenticationBehaviors();
$authenticationBehaviors->setRemoveUnverifiedEmailClaim(true);
$requestBody->setAuthenticationBehaviors($authenticationBehaviors);
$result = $graphServiceClient->applications()->byApplicationId('application-id')->patch($requestBody)->wait();
In der SDK-Dokumentation finden Sie ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider -Instanz.
Import-Module Microsoft.Graph.Beta.Applications
$params = @{
authenticationBehaviors = @{
removeUnverifiedEmailClaim = $true
}
}
Update-MgBetaApplication -ApplicationId $applicationId -BodyParameter $params
In der SDK-Dokumentation finden Sie ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider -Instanz.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.application import Application
from msgraph_beta.generated.models.authentication_behaviors import AuthenticationBehaviors
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = Application(
authentication_behaviors = AuthenticationBehaviors(
remove_unverified_email_claim = True,
),
)
result = await graph_client.applications.by_application_id('application-id').patch(request_body)
In der SDK-Dokumentation finden Sie ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider -Instanz.
Akzeptieren von E-Mail-Adressen mit nicht überprüften Domänenbesitzern in Ansprüchen
Option 1
PATCH https://graph.microsoft.com/beta/applications/03ef14b0-ca33-4840-8f4f-d6e91916010e/authenticationBehaviors
Content-Type: application/json
{
"removeUnverifiedEmailClaim": false
}
const options = {
authProvider,
};
const client = Client.init(options);
const authenticationBehaviors = {
removeUnverifiedEmailClaim: false
};
await client.api('/applications/03ef14b0-ca33-4840-8f4f-d6e91916010e/authenticationBehaviors')
.version('beta')
.update(authenticationBehaviors);
In der SDK-Dokumentation finden Sie ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider -Instanz.
Option 2
PATCH https://graph.microsoft.com/beta/applications/03ef14b0-ca33-4840-8f4f-d6e91916010e
Content-Type: application/json
{
"authenticationBehaviors": {
"removeUnverifiedEmailClaim": false
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new Application
{
AuthenticationBehaviors = new AuthenticationBehaviors
{
RemoveUnverifiedEmailClaim = false,
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Applications["{application-id}"].PatchAsync(requestBody);
In der SDK-Dokumentation finden Sie ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider -Instanz.
// 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.NewApplication()
authenticationBehaviors := graphmodels.NewAuthenticationBehaviors()
removeUnverifiedEmailClaim := false
authenticationBehaviors.SetRemoveUnverifiedEmailClaim(&removeUnverifiedEmailClaim)
requestBody.SetAuthenticationBehaviors(authenticationBehaviors)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
applications, err := graphClient.Applications().ByApplicationId("application-id").Patch(context.Background(), requestBody, nil)
In der SDK-Dokumentation finden Sie ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider -Instanz.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
Application application = new Application();
AuthenticationBehaviors authenticationBehaviors = new AuthenticationBehaviors();
authenticationBehaviors.setRemoveUnverifiedEmailClaim(false);
application.setAuthenticationBehaviors(authenticationBehaviors);
Application result = graphClient.applications().byApplicationId("{application-id}").patch(application);
In der SDK-Dokumentation finden Sie ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider -Instanz.
const options = {
authProvider,
};
const client = Client.init(options);
const application = {
authenticationBehaviors: {
removeUnverifiedEmailClaim: false
}
};
await client.api('/applications/03ef14b0-ca33-4840-8f4f-d6e91916010e')
.version('beta')
.update(application);
In der SDK-Dokumentation finden Sie ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider -Instanz.
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\Application;
use Microsoft\Graph\Beta\Generated\Models\AuthenticationBehaviors;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new Application();
$authenticationBehaviors = new AuthenticationBehaviors();
$authenticationBehaviors->setRemoveUnverifiedEmailClaim(false);
$requestBody->setAuthenticationBehaviors($authenticationBehaviors);
$result = $graphServiceClient->applications()->byApplicationId('application-id')->patch($requestBody)->wait();
In der SDK-Dokumentation finden Sie ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider -Instanz.
Import-Module Microsoft.Graph.Beta.Applications
$params = @{
authenticationBehaviors = @{
removeUnverifiedEmailClaim = $false
}
}
Update-MgBetaApplication -ApplicationId $applicationId -BodyParameter $params
In der SDK-Dokumentation finden Sie ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider -Instanz.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.application import Application
from msgraph_beta.generated.models.authentication_behaviors import AuthenticationBehaviors
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = Application(
authentication_behaviors = AuthenticationBehaviors(
remove_unverified_email_claim = False,
),
)
result = await graph_client.applications.by_application_id('application-id').patch(request_body)
In der SDK-Dokumentation finden Sie ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider -Instanz.
Wiederherstellen des Standardverhaltens
Option 1
PATCH https://graph.microsoft.com/beta/applications/03ef14b0-ca33-4840-8f4f-d6e91916010e/authenticationBehaviors
Content-Type: application/json
{
"removeUnverifiedEmailClaim": null
}
const options = {
authProvider,
};
const client = Client.init(options);
const authenticationBehaviors = {
removeUnverifiedEmailClaim: null
};
await client.api('/applications/03ef14b0-ca33-4840-8f4f-d6e91916010e/authenticationBehaviors')
.version('beta')
.update(authenticationBehaviors);
In der SDK-Dokumentation finden Sie ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider -Instanz.
Option 2
PATCH https://graph.microsoft.com/beta/applications/03ef14b0-ca33-4840-8f4f-d6e91916010e/
Content-Type: application/json
{
"authenticationBehaviors": {
"removeUnverifiedEmailClaim": null
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new Application
{
AuthenticationBehaviors = new AuthenticationBehaviors
{
RemoveUnverifiedEmailClaim = null,
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Applications["{application-id}"].PatchAsync(requestBody);
In der SDK-Dokumentation finden Sie ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider -Instanz.
// 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.NewApplication()
authenticationBehaviors := graphmodels.NewAuthenticationBehaviors()
removeUnverifiedEmailClaim := null
authenticationBehaviors.SetRemoveUnverifiedEmailClaim(&removeUnverifiedEmailClaim)
requestBody.SetAuthenticationBehaviors(authenticationBehaviors)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
applications, err := graphClient.Applications().ByApplicationId("application-id").Patch(context.Background(), requestBody, nil)
In der SDK-Dokumentation finden Sie ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider -Instanz.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
Application application = new Application();
AuthenticationBehaviors authenticationBehaviors = new AuthenticationBehaviors();
authenticationBehaviors.setRemoveUnverifiedEmailClaim(null);
application.setAuthenticationBehaviors(authenticationBehaviors);
Application result = graphClient.applications().byApplicationId("{application-id}").patch(application);
In der SDK-Dokumentation finden Sie ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider -Instanz.
const options = {
authProvider,
};
const client = Client.init(options);
const application = {
authenticationBehaviors: {
removeUnverifiedEmailClaim: null
}
};
await client.api('/applications/03ef14b0-ca33-4840-8f4f-d6e91916010e/')
.version('beta')
.update(application);
In der SDK-Dokumentation finden Sie ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider -Instanz.
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\Application;
use Microsoft\Graph\Beta\Generated\Models\AuthenticationBehaviors;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new Application();
$authenticationBehaviors = new AuthenticationBehaviors();
$authenticationBehaviors->setRemoveUnverifiedEmailClaim(null);
$requestBody->setAuthenticationBehaviors($authenticationBehaviors);
$result = $graphServiceClient->applications()->byApplicationId('application-id')->patch($requestBody)->wait();
In der SDK-Dokumentation finden Sie ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider -Instanz.
Import-Module Microsoft.Graph.Beta.Applications
$params = @{
authenticationBehaviors = @{
removeUnverifiedEmailClaim = $null
}
}
Update-MgBetaApplication -ApplicationId $applicationId -BodyParameter $params
In der SDK-Dokumentation finden Sie ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider -Instanz.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.application import Application
from msgraph_beta.generated.models.authentication_behaviors import AuthenticationBehaviors
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = Application(
authentication_behaviors = AuthenticationBehaviors(
remove_unverified_email_claim = None,
),
)
result = await graph_client.applications.by_application_id('application-id').patch(request_body)
In der SDK-Dokumentation finden Sie ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider -Instanz.
Zulassen des erweiterten Azure AD Graph-Zugriffs bis zum 31. August 2025
Standardmäßig erhalten Anwendungen, die nach dem 31. August 2024 erstellt wurden, beim Senden von Anforderungen an Azure AD Graph-APIs einen 403 Unauthorized Fehler, es sei denn, Sie konfigurieren sie so, dass sie erweiterten Azure AD Graph-Zugriff zulassen. Darüber hinaus müssen Sie vorhandene Apps konfigurieren, die vor dem 31. August 2024 erstellt wurden und Bis zum 1. Februar 2025 Anforderungen an Azure AD Graph-APIs senden, um erweiterten Azure AD Graph-Zugriff zu ermöglichen. Dieser erweiterte Zugriff ist nur bis zum 30. Juni 2025 verfügbar, wenn Azure AD Graph vollständig eingestellt wird. Nach diesem Datum erhalten alle Apps unabhängig von der Konfiguration des erweiterten Zugriffs beim Senden von Anforderungen an Azure AD Graph-APIs einen 403 Unauthorized Fehler. Weitere Informationen finden Sie unter Update vom Juni 2024 zu Azure AD Graph-API Einstellung.
Die folgende Anforderung zeigt, wie Sie eine App aktualisieren, um den erweiterten Azure AD Graph-Zugriff zu ermöglichen. Die in diesem Beispiel verwendete ID ist die Objekt-ID der Anwendung, nicht die Anwendungs-ID. Die Anforderung gibt einen 204 No Content Antwortcode zurück.
Option 1
PATCH https://graph.microsoft.com/beta/applications/5c142e6f-0bd3-4e58-b510-8a106704f44f/authenticationBehaviors
Content-Type: application/json
{
"blockAzureADGraphAccess": false
}
const options = {
authProvider,
};
const client = Client.init(options);
const authenticationBehaviors = {
blockAzureADGraphAccess: false
};
await client.api('/applications/5c142e6f-0bd3-4e58-b510-8a106704f44f/authenticationBehaviors')
.version('beta')
.update(authenticationBehaviors);
In der SDK-Dokumentation finden Sie ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider -Instanz.
Option 2
PATCH https://graph.microsoft.com/beta/applications/5c142e6f-0bd3-4e58-b510-8a106704f44f
Content-Type: application/json
{
"authenticationBehaviors": {
"blockAzureADGraphAccess": false
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new Application
{
AuthenticationBehaviors = new AuthenticationBehaviors
{
BlockAzureADGraphAccess = false,
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Applications["{application-id}"].PatchAsync(requestBody);
In der SDK-Dokumentation finden Sie ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider -Instanz.
// 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.NewApplication()
authenticationBehaviors := graphmodels.NewAuthenticationBehaviors()
blockAzureADGraphAccess := false
authenticationBehaviors.SetBlockAzureADGraphAccess(&blockAzureADGraphAccess)
requestBody.SetAuthenticationBehaviors(authenticationBehaviors)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
applications, err := graphClient.Applications().ByApplicationId("application-id").Patch(context.Background(), requestBody, nil)
In der SDK-Dokumentation finden Sie ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider -Instanz.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
Application application = new Application();
AuthenticationBehaviors authenticationBehaviors = new AuthenticationBehaviors();
authenticationBehaviors.setBlockAzureADGraphAccess(false);
application.setAuthenticationBehaviors(authenticationBehaviors);
Application result = graphClient.applications().byApplicationId("{application-id}").patch(application);
In der SDK-Dokumentation finden Sie ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider -Instanz.
const options = {
authProvider,
};
const client = Client.init(options);
const application = {
authenticationBehaviors: {
blockAzureADGraphAccess: false
}
};
await client.api('/applications/5c142e6f-0bd3-4e58-b510-8a106704f44f')
.version('beta')
.update(application);
In der SDK-Dokumentation finden Sie ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider -Instanz.
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\Application;
use Microsoft\Graph\Beta\Generated\Models\AuthenticationBehaviors;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new Application();
$authenticationBehaviors = new AuthenticationBehaviors();
$authenticationBehaviors->setBlockAzureADGraphAccess(false);
$requestBody->setAuthenticationBehaviors($authenticationBehaviors);
$result = $graphServiceClient->applications()->byApplicationId('application-id')->patch($requestBody)->wait();
In der SDK-Dokumentation finden Sie ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider -Instanz.
Import-Module Microsoft.Graph.Beta.Applications
$params = @{
authenticationBehaviors = @{
blockAzureADGraphAccess = $false
}
}
Update-MgBetaApplication -ApplicationId $applicationId -BodyParameter $params
In der SDK-Dokumentation finden Sie ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider -Instanz.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.application import Application
from msgraph_beta.generated.models.authentication_behaviors import AuthenticationBehaviors
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = Application(
authentication_behaviors = AuthenticationBehaviors(
block_azure_a_d_graph_access = False,
),
)
result = await graph_client.applications.by_application_id('application-id').patch(request_body)
In der SDK-Dokumentation finden Sie ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider -Instanz.
Verwandte Inhalte