Upload a PKCS 12 format key (.pfx) to an API connector's authentication configuration. The input is a base-64 encoded value of the PKCS 12 certificate contents. This method returns an apiConnector.
Permissions
One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.
Permission type
Permissions (from least to most privileged)
Delegated (work or school account)
APIConnectors.ReadWrite.All
Delegated (personal Microsoft account)
Not supported.
Application
APIConnectors.ReadWrite.All
The work or school account needs to belong to one of the following roles:
Global administrator
External Identity User Flow administrator
HTTP request
POST /identity/apiconnectors/{id}/uploadClientCertificate
Request headers
Name
Description
Authorization
Bearer {token}. Required.
Content-type
application/json. Required.
Request body
In the request body, provide a JSON object with the following parameters.
Property
Type
Description
pkcs12Value
String
This is the field for sending the pfx content. The value should be a base-64 encoded version of the actual certificate content. Required.
password
String
This is the password for the pfx file. Required. If no password is used, must still provide a value of "".
Response
If successful, this method returns a 200 OK response code and the apiConnector whose authenticationConfiguration contains the public information of the client certificate.
POST https://graph.microsoft.com/v1.0/identity/apiconnectors/{id}/uploadClientCertificate
Content-type: application/json
{
"pkcs12Value": "eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkEyNTZHQ00ifQ...kDJ04sJShkkgjL9Bm49plA",
"password": "<password>"
}
// Code snippets are only available for the latest version. Current version is 5.x
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new Microsoft.Graph.Identity.ApiConnectors.Item.UploadClientCertificate.UploadClientCertificatePostRequestBody
{
Pkcs12Value = "eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkEyNTZHQ00ifQ...kDJ04sJShkkgjL9Bm49plA",
Password = "<password>",
};
var result = await graphClient.Identity.ApiConnectors["{identityApiConnector-id}"].UploadClientCertificate.PostAsync(requestBody);
<?php
// THIS SNIPPET IS A PREVIEW FOR THE KIOTA BASED SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($requestAdapter);
$requestBody = new UploadClientCertificatePostRequestBody();
$requestBody->setPkcs12Value('eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkEyNTZHQ00ifQ...kDJ04sJShkkgjL9Bm49plA');
$requestBody->setPassword('<password>');
$result = $graphServiceClient->identity()->apiConnectors()->byApiConnectorId('identityApiConnector-id')->uploadClientCertificate()->post($requestBody);