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 .
Dans les scénarios délégués avec des comptes professionnels ou scolaires, l’utilisateur connecté doit se voir attribuer un rôle Microsoft Entra pris en charge ou un rôle personnalisé avec une autorisation de rôle prise en charge. Les rôles les moins privilégiés suivants sont pris en charge pour cette opération :
Administrateur d’appareil cloud
Administrateur d’appareil IoT
Requête HTTP
POST /directory/certificateAuthorities/mutualTlsOauthConfigurations
Propriété à valeurs multiples qui représente une liste d’autorités de certification approuvées. Optional.
displayName
String
Nom convivial. Optional.
tlsClientAuthParameter
tlsClientRegistrationMetadata
Spécifie le champ du certificat qui contient l’ID d’objet. Les valeurs possibles sont tls_client_auth_subject_dn, tls_client_auth_san_dns, tls_client_auth_san_uri, tls_client_auth_san_ip, tls_client_auth_san_email, unknownFutureValue. Obligatoire. En lecture seule.
Réponse
Si elle réussit, cette méthode renvoie un 201 Created code de réponse et un objet mutualTlsOauthConfiguration dans le corps de la réponse. Si un échec de validation se produit pendant les étapes de validation du certificat, la méthode retourne un 400 Bad Request avec le message d’erreur , Invalid value specified for property 'certificate' of resource 'CertificateAuthorityInformation'..
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new MutualTlsOauthConfiguration
{
DisplayName = "DoorCamera_Model_X_TrustedCAs",
TlsClientAuthParameter = TlsClientRegistrationMetadata.Tls_client_auth_san_uri,
CertificateAuthorities = new List<CertificateAuthority>
{
new CertificateAuthority
{
OdataType = "microsoft.graph.certificateAuthority",
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Directory.CertificateAuthorities.MutualTlsOauthConfigurations.PostAsync(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.NewMutualTlsOauthConfiguration()
displayName := "DoorCamera_Model_X_TrustedCAs"
requestBody.SetDisplayName(&displayName)
tlsClientAuthParameter := graphmodels.TLS_CLIENT_AUTH_SAN_URI_TLSCLIENTREGISTRATIONMETADATA
requestBody.SetTlsClientAuthParameter(&tlsClientAuthParameter)
certificateAuthority := graphmodels.NewCertificateAuthority()
certificateAuthorities := []graphmodels.CertificateAuthorityable {
certificateAuthority,
}
requestBody.SetCertificateAuthorities(certificateAuthorities)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
mutualTlsOauthConfigurations, err := graphClient.Directory().CertificateAuthorities().MutualTlsOauthConfigurations().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
MutualTlsOauthConfiguration mutualTlsOauthConfiguration = new MutualTlsOauthConfiguration();
mutualTlsOauthConfiguration.setDisplayName("DoorCamera_Model_X_TrustedCAs");
mutualTlsOauthConfiguration.setTlsClientAuthParameter(TlsClientRegistrationMetadata.Tls_client_auth_san_uri);
LinkedList<CertificateAuthority> certificateAuthorities = new LinkedList<CertificateAuthority>();
CertificateAuthority certificateAuthority = new CertificateAuthority();
certificateAuthority.setOdataType("microsoft.graph.certificateAuthority");
certificateAuthorities.add(certificateAuthority);
mutualTlsOauthConfiguration.setCertificateAuthorities(certificateAuthorities);
MutualTlsOauthConfiguration result = graphClient.directory().certificateAuthorities().mutualTlsOauthConfigurations().post(mutualTlsOauthConfiguration);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\MutualTlsOauthConfiguration;
use Microsoft\Graph\Beta\Generated\Models\TlsClientRegistrationMetadata;
use Microsoft\Graph\Beta\Generated\Models\CertificateAuthority;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new MutualTlsOauthConfiguration();
$requestBody->setDisplayName('DoorCamera_Model_X_TrustedCAs');
$requestBody->setTlsClientAuthParameter(new TlsClientRegistrationMetadata('tls_client_auth_san_uri'));
$certificateAuthoritiesCertificateAuthority1 = new CertificateAuthority();
$certificateAuthoritiesCertificateAuthority1->setOdataType('microsoft.graph.certificateAuthority');
$certificateAuthoritiesArray []= $certificateAuthoritiesCertificateAuthority1;
$requestBody->setCertificateAuthorities($certificateAuthoritiesArray);
$result = $graphServiceClient->directory()->certificateAuthorities()->mutualTlsOauthConfigurations()->post($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.mutual_tls_oauth_configuration import MutualTlsOauthConfiguration
from msgraph_beta.generated.models.tls_client_registration_metadata import TlsClientRegistrationMetadata
from msgraph_beta.generated.models.certificate_authority import CertificateAuthority
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = MutualTlsOauthConfiguration(
display_name = "DoorCamera_Model_X_TrustedCAs",
tls_client_auth_parameter = TlsClientRegistrationMetadata.Tls_client_auth_san_uri,
certificate_authorities = [
CertificateAuthority(
odata_type = "microsoft.graph.certificateAuthority",
),
],
)
result = await graph_client.directory.certificate_authorities.mutual_tls_oauth_configurations.post(request_body)