Namespace: microsoft.graph
Erstellen Sie ein neues benutzerdefiniertes AuthenticationStrengthPolicy-Objekt .
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) |
Policy.ReadWrite.ConditionalAccess |
Policy.ReadWrite.AuthenticationMethod |
| Delegiert (persönliches Microsoft-Konto) |
Nicht unterstützt |
Nicht unterstützt |
| Application |
Policy.ReadWrite.ConditionalAccess |
Policy.ReadWrite.AuthenticationMethod |
Wichtig
In delegierten Szenarien mit Geschäfts-, Schul- oder Unikonten muss dem angemeldeten Benutzer eine unterstützte Microsoft Entra Rolle oder eine benutzerdefinierte Rolle mit einer unterstützten Rollenberechtigung zugewiesen werden. Die folgenden Rollen mit den geringsten Berechtigungen werden für diesen Vorgang unterstützt.
- Administrator für bedingten Zugriff
- Sicherheitsadministrator
HTTP-Anforderung
POST /policies/authenticationStrengthPolicies
Anforderungstext
Geben Sie im Anforderungstext eine JSON-Darstellung des authenticationStrengthPolicy-Objekts an.
Sie können die folgenden Eigenschaften angeben, wenn Sie eine authenticationStrengthPolicy erstellen.
| Eigenschaft |
Typ |
Beschreibung |
| displayName |
Zeichenfolge |
Der Anzeigename der zu erstellenden Richtlinie. Erforderlich. |
| description |
Zeichenfolge |
Die Beschreibung der zu erstellenden Richtlinie. Optional. |
| allowedCombinations |
authenticationMethodModes-Auflistung |
Die von dieser Richtlinie für die Authentifizierungsstärke zulässigen Authentifizierungsmethodenkombinationen. Die möglichen Werte dieser gekennzeichneten Enumeration sind: password, , voice, hardwareOath, softwareOath, sms, fido2, windowsHelloForBusiness, microsoftAuthenticatorPush, deviceBasedPush, temporaryAccessPassOneTime, , , temporaryAccessPassMultiUse, . x509CertificateSingleFactorunknownFutureValueemailx509CertificateMultiFactorfederatedSingleFactorfederatedMultiFactor Rufen Sie die List authenticationMethodModes-API auf, um die Liste der zulässigen Kombinationen zu erhalten. Erforderlich. |
Antwort
Bei erfolgreicher Ausführung gibt die Methode den 201 Created Antwortcode und ein authenticationStrengthPolicy-Objekt im Antworttext zurück.
Beispiele
Anforderung
Das folgende Beispiel zeigt eine Anfrage.
POST https://graph.microsoft.com/v1.0/policies/authenticationStrengthPolicies
Content-Type: application/json
{
"displayName": "Example",
"requirementsSatisfied": "mfa",
"allowedCombinations": [
"fido2"
],
"combinationConfigurations@odata.context": "https://graph.microsoft.com/v1.0/$metadata#policies/authenticationStrengthPolicies('5790842a-5bab-44c2-9cf1-b38d675b70ea')/combinationConfigurations",
"combinationConfigurations": [
{
"@odata.type": "#microsoft.graph.fido2CombinationConfiguration",
"id": "42235320-c8db-4d8c-9344-8f1ce87f734b",
"appliesToCombinations": [
"fido2"
],
"allowedAAGUIDs": [
"de1e552d-db1d-4423-a619-566b625cdc84",
"90a3ccdf-635c-4729-a248-9b709135078f"
]
}
]
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new AuthenticationStrengthPolicy
{
DisplayName = "Example",
RequirementsSatisfied = AuthenticationStrengthRequirements.Mfa,
AllowedCombinations = new List<AuthenticationMethodModes?>
{
AuthenticationMethodModes.Fido2,
},
CombinationConfigurations = new List<AuthenticationCombinationConfiguration>
{
new Fido2CombinationConfiguration
{
OdataType = "#microsoft.graph.fido2CombinationConfiguration",
Id = "42235320-c8db-4d8c-9344-8f1ce87f734b",
AppliesToCombinations = new List<AuthenticationMethodModes?>
{
AuthenticationMethodModes.Fido2,
},
AllowedAAGUIDs = new List<string>
{
"de1e552d-db1d-4423-a619-566b625cdc84",
"90a3ccdf-635c-4729-a248-9b709135078f",
},
},
},
AdditionalData = new Dictionary<string, object>
{
{
"combinationConfigurations@odata.context" , "https://graph.microsoft.com/v1.0/$metadata#policies/authenticationStrengthPolicies('5790842a-5bab-44c2-9cf1-b38d675b70ea')/combinationConfigurations"
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Policies.AuthenticationStrengthPolicies.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.NewAuthenticationStrengthPolicy()
displayName := "Example"
requestBody.SetDisplayName(&displayName)
requirementsSatisfied := graphmodels.MFA_AUTHENTICATIONSTRENGTHREQUIREMENTS
requestBody.SetRequirementsSatisfied(&requirementsSatisfied)
allowedCombinations := []graphmodels.AuthenticationMethodModesable {
authenticationMethodModes := graphmodels.FIDO2_AUTHENTICATIONMETHODMODES
requestBody.SetAuthenticationMethodModes(&authenticationMethodModes)
}
requestBody.SetAllowedCombinations(allowedCombinations)
authenticationCombinationConfiguration := graphmodels.NewFido2CombinationConfiguration()
id := "42235320-c8db-4d8c-9344-8f1ce87f734b"
authenticationCombinationConfiguration.SetId(&id)
appliesToCombinations := []graphmodels.AuthenticationMethodModesable {
authenticationMethodModes := graphmodels.FIDO2_AUTHENTICATIONMETHODMODES
authenticationCombinationConfiguration.SetAuthenticationMethodModes(&authenticationMethodModes)
}
authenticationCombinationConfiguration.SetAppliesToCombinations(appliesToCombinations)
allowedAAGUIDs := []string {
"de1e552d-db1d-4423-a619-566b625cdc84",
"90a3ccdf-635c-4729-a248-9b709135078f",
}
authenticationCombinationConfiguration.SetAllowedAAGUIDs(allowedAAGUIDs)
combinationConfigurations := []graphmodels.AuthenticationCombinationConfigurationable {
authenticationCombinationConfiguration,
}
requestBody.SetCombinationConfigurations(combinationConfigurations)
additionalData := map[string]interface{}{
"combinationConfigurations@odata.context" : "https://graph.microsoft.com/v1.0/$metadata#policies/authenticationStrengthPolicies('5790842a-5bab-44c2-9cf1-b38d675b70ea')/combinationConfigurations",
}
requestBody.SetAdditionalData(additionalData)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
authenticationStrengthPolicies, err := graphClient.Policies().AuthenticationStrengthPolicies().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);
AuthenticationStrengthPolicy authenticationStrengthPolicy = new AuthenticationStrengthPolicy();
authenticationStrengthPolicy.setDisplayName("Example");
authenticationStrengthPolicy.setRequirementsSatisfied(EnumSet.of(AuthenticationStrengthRequirements.Mfa));
LinkedList<AuthenticationMethodModes> allowedCombinations = new LinkedList<AuthenticationMethodModes>();
allowedCombinations.add(AuthenticationMethodModes.Fido2);
authenticationStrengthPolicy.setAllowedCombinations(allowedCombinations);
LinkedList<AuthenticationCombinationConfiguration> combinationConfigurations = new LinkedList<AuthenticationCombinationConfiguration>();
Fido2CombinationConfiguration authenticationCombinationConfiguration = new Fido2CombinationConfiguration();
authenticationCombinationConfiguration.setOdataType("#microsoft.graph.fido2CombinationConfiguration");
authenticationCombinationConfiguration.setId("42235320-c8db-4d8c-9344-8f1ce87f734b");
LinkedList<AuthenticationMethodModes> appliesToCombinations = new LinkedList<AuthenticationMethodModes>();
appliesToCombinations.add(AuthenticationMethodModes.Fido2);
authenticationCombinationConfiguration.setAppliesToCombinations(appliesToCombinations);
LinkedList<String> allowedAAGUIDs = new LinkedList<String>();
allowedAAGUIDs.add("de1e552d-db1d-4423-a619-566b625cdc84");
allowedAAGUIDs.add("90a3ccdf-635c-4729-a248-9b709135078f");
authenticationCombinationConfiguration.setAllowedAAGUIDs(allowedAAGUIDs);
combinationConfigurations.add(authenticationCombinationConfiguration);
authenticationStrengthPolicy.setCombinationConfigurations(combinationConfigurations);
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("combinationConfigurations@odata.context", "https://graph.microsoft.com/v1.0/$metadata#policies/authenticationStrengthPolicies('5790842a-5bab-44c2-9cf1-b38d675b70ea')/combinationConfigurations");
authenticationStrengthPolicy.setAdditionalData(additionalData);
AuthenticationStrengthPolicy result = graphClient.policies().authenticationStrengthPolicies().post(authenticationStrengthPolicy);
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 authenticationStrengthPolicy = {
displayName: 'Example',
requirementsSatisfied: 'mfa',
allowedCombinations: [
'fido2'
],
'combinationConfigurations@odata.context': 'https://graph.microsoft.com/v1.0/$metadata#policies/authenticationStrengthPolicies(\'5790842a-5bab-44c2-9cf1-b38d675b70ea\')/combinationConfigurations',
combinationConfigurations: [
{
'@odata.type': '#microsoft.graph.fido2CombinationConfiguration',
id: '42235320-c8db-4d8c-9344-8f1ce87f734b',
appliesToCombinations: [
'fido2'
],
allowedAAGUIDs: [
'de1e552d-db1d-4423-a619-566b625cdc84',
'90a3ccdf-635c-4729-a248-9b709135078f'
]
}
]
};
await client.api('/policies/authenticationStrengthPolicies')
.post(authenticationStrengthPolicy);
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\AuthenticationStrengthPolicy;
use Microsoft\Graph\Generated\Models\AuthenticationStrengthRequirements;
use Microsoft\Graph\Generated\Models\AuthenticationMethodModes;
use Microsoft\Graph\Generated\Models\AuthenticationCombinationConfiguration;
use Microsoft\Graph\Generated\Models\Fido2CombinationConfiguration;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new AuthenticationStrengthPolicy();
$requestBody->setDisplayName('Example');
$requestBody->setRequirementsSatisfied(new AuthenticationStrengthRequirements('mfa'));
$requestBody->setAllowedCombinations([new AuthenticationMethodModes('fido2'), ]);
$combinationConfigurationsAuthenticationCombinationConfiguration1 = new Fido2CombinationConfiguration();
$combinationConfigurationsAuthenticationCombinationConfiguration1->setOdataType('#microsoft.graph.fido2CombinationConfiguration');
$combinationConfigurationsAuthenticationCombinationConfiguration1->setId('42235320-c8db-4d8c-9344-8f1ce87f734b');
$combinationConfigurationsAuthenticationCombinationConfiguration1->setAppliesToCombinations([new AuthenticationMethodModes('fido2'), ]);
$combinationConfigurationsAuthenticationCombinationConfiguration1->setAllowedAAGUIDs(['de1e552d-db1d-4423-a619-566b625cdc84', '90a3ccdf-635c-4729-a248-9b709135078f', ]);
$combinationConfigurationsArray []= $combinationConfigurationsAuthenticationCombinationConfiguration1;
$requestBody->setCombinationConfigurations($combinationConfigurationsArray);
$additionalData = [
'combinationConfigurations@odata.context' => 'https://graph.microsoft.com/v1.0/$metadata#policies/authenticationStrengthPolicies(\'5790842a-5bab-44c2-9cf1-b38d675b70ea\')/combinationConfigurations',
];
$requestBody->setAdditionalData($additionalData);
$result = $graphServiceClient->policies()->authenticationStrengthPolicies()->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 = @{
displayName = "Example"
requirementsSatisfied = "mfa"
allowedCombinations = @(
"fido2"
)
"combinationConfigurations@odata.context" = "https://graph.microsoft.com/v1.0/$metadata#policies/authenticationStrengthPolicies('5790842a-5bab-44c2-9cf1-b38d675b70ea')/combinationConfigurations"
combinationConfigurations = @(
@{
"@odata.type" = "#microsoft.graph.fido2CombinationConfiguration"
id = "42235320-c8db-4d8c-9344-8f1ce87f734b"
appliesToCombinations = @(
"fido2"
)
allowedAAGUIDs = @(
"de1e552d-db1d-4423-a619-566b625cdc84"
"90a3ccdf-635c-4729-a248-9b709135078f"
)
}
)
}
New-MgPolicyAuthenticationStrengthPolicy -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_strength_policy import AuthenticationStrengthPolicy
from msgraph.generated.models.authentication_strength_requirements import AuthenticationStrengthRequirements
from msgraph.generated.models.authentication_method_modes import AuthenticationMethodModes
from msgraph.generated.models.authentication_combination_configuration import AuthenticationCombinationConfiguration
from msgraph.generated.models.fido2_combination_configuration import Fido2CombinationConfiguration
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = AuthenticationStrengthPolicy(
display_name = "Example",
requirements_satisfied = AuthenticationStrengthRequirements.Mfa,
allowed_combinations = [
AuthenticationMethodModes.Fido2,
],
combination_configurations = [
Fido2CombinationConfiguration(
odata_type = "#microsoft.graph.fido2CombinationConfiguration",
id = "42235320-c8db-4d8c-9344-8f1ce87f734b",
applies_to_combinations = [
AuthenticationMethodModes.Fido2,
],
allowed_a_a_g_u_i_ds = [
"de1e552d-db1d-4423-a619-566b625cdc84",
"90a3ccdf-635c-4729-a248-9b709135078f",
],
),
],
additional_data = {
"combination_configurations@odata_context" : "https://graph.microsoft.com/v1.0/$metadata#policies/authenticationStrengthPolicies('5790842a-5bab-44c2-9cf1-b38d675b70ea')/combinationConfigurations",
}
)
result = await graph_client.policies.authentication_strength_policies.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#policies/authenticationStrengthPolicies/$entity",
"id": "7daf2132-6a2d-4e78-a699-b823babf4436",
"createdDateTime": "2024-07-23T17:10:58.1492045Z",
"modifiedDateTime": "2024-07-23T17:10:58.1492045Z",
"displayName": "Example",
"description": "",
"policyType": "custom",
"requirementsSatisfied": "mfa",
"allowedCombinations": [
"fido2"
],
"combinationConfigurations@odata.context": "https://graph.microsoft.com/v1.0/$metadata#policies/authenticationStrengthPolicies('7daf2132-6a2d-4e78-a699-b823babf4436')/combinationConfigurations",
"combinationConfigurations": [
{
"@odata.type": "#microsoft.graph.fido2CombinationConfiguration",
"id": "c0fdf2f9-3b3f-4bbf-988c-17606ea4b4e4",
"appliesToCombinations": [
"fido2"
],
"allowedAAGUIDs": [
"de1e552d-db1d-4423-a619-566b625cdc84",
"90a3ccdf-635c-4729-a248-9b709135078f"
]
}
]
}