Skip to content

Latest commit

 

History

History
138 lines (108 loc) · 4.86 KB

File metadata and controls

138 lines (108 loc) · 4.86 KB
title user: validatePassword
description Check a user's password against the organization's password validation policy and report whether the password is valid.
author yyuank
ms.reviewer iamut
ms.localizationpriority medium
ms.subservice entra-users
doc_type apiPageType
ms.date 4/15/2026

user: validatePassword

Namespace: microsoft.graph

[!INCLUDE beta-disclaimer]

Check a user's password against the organization's password validation policy and report whether the password is valid. Use this action to provide real-time feedback on password strength while the user types their password.

[!INCLUDE national-cloud-support]

Permissions

Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.

[!INCLUDE permissions-table]

Important

In delegated scenarios with work or school accounts, the signed-in user must be assigned a supported Microsoft Entra role or a custom role with a supported role permission. The following least privileged roles are supported for this operation:

  • Password Administrator
  • Helpdesk Administrator
  • User Administrator
  • Global Administrator

HTTP request

POST /users/validatePassword

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.
Content-Type application/json. Required.

Request body

In the request body, supply JSON representation of the parameters.

The following table shows the parameters that are required with this action.

Parameter Type Description
password String The password to be validated by this action.

Response

If successful, this action returns a 200 OK response code and a passwordValidationInformation object in the response body.

Examples

Request

POST https://graph.microsoft.com/beta/users/validatePassword
Content-Type: application/json

{
    "password": "1234567890"
}

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]


Response

The following example shows the response.

Note: The response object shown here might be shortened for readability.

HTTP/1.1 200 OK
Content-Type: application/json

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#users/$entity",
    "isValid": false,
    "validationResults": [
        {
            "ruleName": "password_not_meet_complexity",
            "validationPassed": false,
            "message": "Password does not meet complexity requirements."
        }
    ]
}