Skip to main content
POST
/
v1
/
passwords
/
strength_check
C#
// POST /v1/passwords/strength_check
const stytch = require('stytch');

const client = new stytch.Client({
  project_id: '${projectId}',
  secret: '${secret}',
});

const params = {
  password: "${examplePassword}",
};

client.Passwords.StrengthCheck(params)
  .then(resp => { console.log(resp) })
  .catch(err => { console.log(err) });
{
  "request_id": "<string>",
  "valid_password": true,
  "score": 123,
  "breached_password": true,
  "strength_policy": "<string>",
  "breach_detection_on_create": true,
  "status_code": 123,
  "feedback": {
    "warning": "<string>",
    "suggestions": [
      "<string>"
    ],
    "luds_requirements": {
      "has_lower_case": true,
      "has_upper_case": true,
      "has_digit": true,
      "has_symbol": true,
      "missing_complexity": 123,
      "missing_characters": 123
    }
  }
}
This API allows you to check whether or not the user’s provided password is valid, and to provide feedback to the user on how to increase the strength of their password. This endpoint adapts to your Project’s password strength configuration. If you’re using zxcvbn, the default, your passwords are considered valid if the strength score is >= 3. If you’re using LUDS, your passwords are considered valid if they meet the requirements that you’ve set with Stytch. Update your password strength configuration in the Stytch Dashboard.

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Body

application/json

Request type

password
string
required

The password for the user. Any UTF8 character is allowed, e.g. spaces, emojis, non-English characters, etc.

email
string

The email address of the end user.

Response

Successful response

request_id
string
required

Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue.

valid_password
boolean
required

Returns true if the password passes our password validation. We offer two validation options, zxcvbn is the default option which offers a high level of sophistication. We also offer LUDS which is less sophisticated but easier to understand. If an email address is included in the call we also require that the password hasn't been compromised using built-in breach detection powered by HaveIBeenPwned.

score
integer<int32>
required

The score of the password determined by zxcvbn. Values will be between 1 and 4, a 3 or greater is required to pass validation.

breached_password
boolean
required

Returns true if the password has been breached. Powered by HaveIBeenPwned.

strength_policy
string
required

The strength policy type enforced, either zxcvbn or luds.

breach_detection_on_create
boolean
required

Will return true if breach detection will be evaluated. By default this option is enabled. This option can be disabled in the dashboard. If this value is false then breached_password will always be false as well.

status_code
integer<int32>
required

The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.

feedback
object

Feedback for how to improve the password's strength HaveIBeenPwned.