synchronizationJob: validateCredentials

Namespace: microsoft.graph

Important

APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.

Validate that the credentials are valid in the tenant.

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) Directory.ReadWrite.All
Delegated (personal Microsoft account) Not supported.
Application Application.ReadWrite.OwnedBy, Directory.ReadWrite.All

HTTP request

POST /servicePrincipals/{id}/synchronization/jobs/{id}/validateCredentials

Request headers

Name Description
Authorization Bearer {code}

Request body

In the request body, provide a JSON object with the following parameters.

Parameter Type Description
useSavedCredentials Boolean When true, the credentials parameter will be ignored and the previously saved credentials (if any) will be validated instead.
credentials synchronizationSecretKeyStringValuePair collection Credentials to validate. Ignored when the useSavedCredentials parameter is true.

Response

If validation is successful, this method returns a 204, No Content response code. It does not return anything in the response body.

Example

Request

The following is an example of the request.

POST https://graph.microsoft.com/beta/servicePrincipals/{id}/synchronization/jobs/{id}/validateCredentials
Content-type: application/json

{ 
    credentials: [ 
        { key: "UserName", value: "user@domain.com" },
        { key: "Password", value: "password-value" }
    ]
}
Response

The following is an example of the response.

HTTP/1.1 204 No Content