Espace de noms: microsoft.graph
Importante
Les API sous la version /beta dans Microsoft Graph sont susceptibles d’être modifiées. L’utilisation de ces API dans des applications de production n’est pas prise en charge. Pour déterminer si une API est disponible dans v1.0, utilisez le sélecteur Version .
Mettez à jour les propriétés d’un objet authenticationStrengthPolicy . Vous ne pouvez pas mettre à jour les combinaisons de méthodes d’authentification autorisées à l’aide de cette requête. Pour ce faire, utilisez l’action Mettre à jour les combinaisons autorisées .
Cette API est disponible dans les déploiements de cloud national suivants.
| Service global |
Gouvernement des États-Unis L4 |
Us Government L5 (DOD) |
Chine gérée par 21Vianet |
| ✅ |
✅ |
✅ |
❌ |
Autorisations
Choisissez l’autorisation ou les autorisations marquées comme moins privilégiées pour cette API. Utilisez une autorisation ou des autorisations privilégiées plus élevées uniquement si votre application en a besoin. Pour plus d’informations sur les autorisations déléguées et d’application, consultez Types d’autorisations. Pour en savoir plus sur ces autorisations, consultez les informations de référence sur les autorisations.
| Type d’autorisation |
Autorisations avec privilèges minimum |
Autorisations privilégiées plus élevées |
| Déléguée (compte professionnel ou scolaire) |
Policy.ReadWrite.ConditionalAccess |
Policy.ReadWrite.AuthenticationMethod |
| Déléguée (compte Microsoft personnel) |
Non prise en charge. |
Non prise en charge. |
| Application |
Policy.ReadWrite.ConditionalAccess |
Policy.ReadWrite.AuthenticationMethod |
Requête HTTP
PATCH /policies/authenticationStrengthPolicies/{authenticationStrengthPolicyId}
Corps de la demande
Dans le corps de la demande, fournissez uniquement les valeurs des propriétés à mettre à jour. Les propriétés existantes qui ne sont pas incluses dans le corps de la demande conservent leurs valeurs précédentes ou sont recalculées en fonction des modifications apportées à d’autres valeurs de propriété.
Le tableau suivant spécifie les propriétés qui peuvent être mises à jour.
| Propriété |
Type |
Description |
| displayName |
String |
Nom complet de la stratégie à créer. Facultatif. |
| description |
String |
Description de la stratégie à créer. Facultatif. |
Réponse
Si elle réussit, cette méthode renvoie un code de réponse 204 NO CONTENT.
Exemples
Demande
L’exemple suivant illustre une demande.
PATCH https://graph.microsoft.com/beta/policies/authenticationStrengthPolicies/a34a4c89-c5bf-4c0b-927d-adc396bf1f19
Content-Type: application/json
Content-length: 239
{
"@odata.type": "#microsoft.graph.authenticationStrengthPolicy",
"displayName": "FIDO2 only",
"description": "An auth strength allowing only FIDO2 security keys."
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new AuthenticationStrengthPolicy
{
OdataType = "#microsoft.graph.authenticationStrengthPolicy",
DisplayName = "FIDO2 only",
Description = "An auth strength allowing only FIDO2 security keys.",
};
// 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["{authenticationStrengthPolicy-id}"].PatchAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewAuthenticationStrengthPolicy()
displayName := "FIDO2 only"
requestBody.SetDisplayName(&displayName)
description := "An auth strength allowing only FIDO2 security keys."
requestBody.SetDescription(&description)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
authenticationStrengthPolicies, err := graphClient.Policies().AuthenticationStrengthPolicies().ByAuthenticationStrengthPolicyId("authenticationStrengthPolicy-id").Patch(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
AuthenticationStrengthPolicy authenticationStrengthPolicy = new AuthenticationStrengthPolicy();
authenticationStrengthPolicy.setOdataType("#microsoft.graph.authenticationStrengthPolicy");
authenticationStrengthPolicy.setDisplayName("FIDO2 only");
authenticationStrengthPolicy.setDescription("An auth strength allowing only FIDO2 security keys.");
AuthenticationStrengthPolicy result = graphClient.policies().authenticationStrengthPolicies().byAuthenticationStrengthPolicyId("{authenticationStrengthPolicy-id}").patch(authenticationStrengthPolicy);
const options = {
authProvider,
};
const client = Client.init(options);
const authenticationStrengthPolicy = {
'@odata.type': '#microsoft.graph.authenticationStrengthPolicy',
displayName: 'FIDO2 only',
description: 'An auth strength allowing only FIDO2 security keys.'
};
await client.api('/policies/authenticationStrengthPolicies/a34a4c89-c5bf-4c0b-927d-adc396bf1f19')
.version('beta')
.update(authenticationStrengthPolicy);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\AuthenticationStrengthPolicy;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new AuthenticationStrengthPolicy();
$requestBody->setOdataType('#microsoft.graph.authenticationStrengthPolicy');
$requestBody->setDisplayName('FIDO2 only');
$requestBody->setDescription('An auth strength allowing only FIDO2 security keys.');
$result = $graphServiceClient->policies()->authenticationStrengthPolicies()->byAuthenticationStrengthPolicyId('authenticationStrengthPolicy-id')->patch($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Identity.SignIns
$params = @{
"@odata.type" = "#microsoft.graph.authenticationStrengthPolicy"
displayName = "FIDO2 only"
description = "An auth strength allowing only FIDO2 security keys."
}
Update-MgBetaPolicyAuthenticationStrengthPolicy -AuthenticationStrengthPolicyId $authenticationStrengthPolicyId -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.authentication_strength_policy import AuthenticationStrengthPolicy
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = AuthenticationStrengthPolicy(
odata_type = "#microsoft.graph.authenticationStrengthPolicy",
display_name = "FIDO2 only",
description = "An auth strength allowing only FIDO2 security keys.",
)
result = await graph_client.policies.authentication_strength_policies.by_authentication_strength_policy_id('authenticationStrengthPolicy-id').patch(request_body)
Réponse
L’exemple suivant illustre la réponse.
HTTP/1.1 204 No Content