Escolha a permissão ou permissões marcadas como menos privilegiadas para esta API. Utilize uma permissão ou permissões com privilégios mais elevados apenas se a sua aplicação o exigir. Para obter detalhes sobre as permissões delegadas e de aplicação, veja Tipos de permissão. Para saber mais sobre estas permissões, veja a referência de permissões.
Tipo de permissão
Permissões com menos privilégios
Permissões com privilégios superiores
Delegado (conta corporativa ou de estudante)
Policy.ReadWrite.ConditionalAccess
Policy.ReadWrite.AuthenticationMethod
Delegado (conta pessoal da Microsoft)
Sem suporte.
Sem suporte.
Application
Policy.ReadWrite.ConditionalAccess
Policy.ReadWrite.AuthenticationMethod
Importante
Em cenários delegados com contas escolares ou profissionais, o utilizador com sessão iniciada tem de ter uma função de Microsoft Entra suportada ou uma função personalizada com uma permissão de função suportada. As seguintes funções com menos privilégios são suportadas para esta operação.
Administrador de Acesso Condicional
Administrador de Segurança
Solicitação HTTP
POST /policies/authenticationStrengthPolicies/{authenticationStrengthPolicyId}/updateAllowedCombinations
No corpo do pedido, forneça uma representação JSON dos parâmetros.
A tabela a seguir mostra os parâmetros que podem ser usados com esta ação.
Parâmetro
Tipo
Descrição
allowedCombinations
authenticationMethodModes collection
As combinações de métodos de autenticação permitidas por esta política de força de autenticação. Os valores possíveis desta enumeração sinalizada são: password, , hardwareOathvoice, softwareOath, sms, fido2, windowsHelloForBusiness, microsoftAuthenticatorPush, deviceBasedPush, , temporaryAccessPassOneTime, temporaryAccessPassMultiUse, , , email, x509CertificateSingleFactorx509CertificateMultiFactor, , , federatedSingleFactor, , federatedMultiFactor, unknownFutureValue. Para obter a lista de combinações permitidas, chame a API List authenticationMethodModes . Obrigatório.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Policies.AuthenticationStrengthPolicies.Item.UpdateAllowedCombinations;
using Microsoft.Graph.Models;
var requestBody = new UpdateAllowedCombinationsPostRequestBody
{
AllowedCombinations = new List<AuthenticationMethodModes?>
{
AuthenticationMethodModes.Password | AuthenticationMethodModes.Voice,
},
};
// 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}"].UpdateAllowedCombinations.PostAsync(requestBody);
// 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"
graphpolicies "github.com/microsoftgraph/msgraph-sdk-go/policies"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphpolicies.NewUpdateAllowedCombinationsPostRequestBody()
allowedCombinations := []graphmodels.AuthenticationMethodModesable {
authenticationMethodModes := graphmodels.PASSWORD, VOICE_AUTHENTICATIONMETHODMODES
requestBody.SetAuthenticationMethodModes(&authenticationMethodModes)
}
requestBody.SetAllowedCombinations(allowedCombinations)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
updateAllowedCombinations, err := graphClient.Policies().AuthenticationStrengthPolicies().ByAuthenticationStrengthPolicyId("authenticationStrengthPolicy-id").UpdateAllowedCombinations().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.policies.authenticationstrengthpolicies.item.updateallowedcombinations.UpdateAllowedCombinationsPostRequestBody updateAllowedCombinationsPostRequestBody = new com.microsoft.graph.policies.authenticationstrengthpolicies.item.updateallowedcombinations.UpdateAllowedCombinationsPostRequestBody();
LinkedList<AuthenticationMethodModes> allowedCombinations = new LinkedList<AuthenticationMethodModes>();
allowedCombinations.add(AuthenticationMethodModes.Password);
allowedCombinations.add(AuthenticationMethodModes.Voice);
updateAllowedCombinationsPostRequestBody.setAllowedCombinations(allowedCombinations);
var result = graphClient.policies().authenticationStrengthPolicies().byAuthenticationStrengthPolicyId("{authenticationStrengthPolicy-id}").updateAllowedCombinations().post(updateAllowedCombinationsPostRequestBody);
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Policies\AuthenticationStrengthPolicies\Item\UpdateAllowedCombinations\UpdateAllowedCombinationsPostRequestBody;
use Microsoft\Graph\Generated\Models\AuthenticationMethodModes;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new UpdateAllowedCombinationsPostRequestBody();
$requestBody->setAllowedCombinations([new AuthenticationMethodModes('password, voice'), ]);
$result = $graphServiceClient->policies()->authenticationStrengthPolicies()->byAuthenticationStrengthPolicyId('authenticationStrengthPolicy-id')->updateAllowedCombinations()->post($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.policies.authenticationstrengthpolicies.item.update_allowed_combinations.update_allowed_combinations_post_request_body import UpdateAllowedCombinationsPostRequestBody
from msgraph.generated.models.authentication_method_modes import AuthenticationMethodModes
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = UpdateAllowedCombinationsPostRequestBody(
allowed_combinations = [
AuthenticationMethodModes.Password | AuthenticationMethodModes.Voice,
],
)
result = await graph_client.policies.authentication_strength_policies.by_authentication_strength_policy_id('authenticationStrengthPolicy-id').update_allowed_combinations.post(request_body)
Observação: o objeto de resposta mostrado aqui pode ser encurtado para legibilidade.
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.type" : "#microsoft.graph.updateAllowedCombinationsResult",
"previousCombinations": [
"fido2",
"password, voice"
],
"currentCombinations": [
"password, voice"
],
"conditionalAccessReferences": [
"53a3968a-ae2c-4b82-a313-091d10c52bfa"
],
"additionalInformation": "You have lowered the security of the My Custom Strength authentication strength by adding a lower security combination. This Authentication Strength is referenced by one or more Conditional Access policies. Review conditionalAccessReferences to understand which Conditional Access policies were impacted by this change. To reverse your changes back, use updateAllowedCombinations action with the previousCombinations values."
}