Files
Chase HartsellandGitHub 573f8f077e Add support for validating passwords against the password policy in auth (#7514)
* Implement validatePassword endpoint for public API with PasswordPolicy and PasswordValidationStatus public types

* Update auth demo to include a section for password validation
2023-08-07 11:54:25 -07:00

2.4 KiB

Project: /docs/reference/js/_project.yaml Book: /docs/reference/_book.yaml page_type: reference

{% comment %} DO NOT EDIT THIS FILE! This is generated by the JS SDK team, and any local changes will be overwritten. Changes should be made in the source code at https://github.com/firebase/firebase-js-sdk {% endcomment %}

PasswordPolicy interface

A structure specifying password policy requirements.

Signature:

export interface PasswordPolicy 

Properties

Property Type Description
allowedNonAlphanumericCharacters string List of characters that are considered non-alphanumeric during validation.
customStrengthOptions { readonly minPasswordLength?: number; readonly maxPasswordLength?: number; readonly containsLowercaseLetter?: boolean; readonly containsUppercaseLetter?: boolean; readonly containsNumericCharacter?: boolean; readonly containsNonAlphanumericCharacter?: boolean; } Requirements enforced by this password policy.
enforcementState string The enforcement state of the policy. Can be 'OFF' or 'ENFORCE'.
forceUpgradeOnSignin boolean Whether existing passwords must meet the policy.

PasswordPolicy.allowedNonAlphanumericCharacters

List of characters that are considered non-alphanumeric during validation.

Signature:

readonly allowedNonAlphanumericCharacters: string;

PasswordPolicy.customStrengthOptions

Requirements enforced by this password policy.

Signature:

readonly customStrengthOptions: {
        readonly minPasswordLength?: number;
        readonly maxPasswordLength?: number;
        readonly containsLowercaseLetter?: boolean;
        readonly containsUppercaseLetter?: boolean;
        readonly containsNumericCharacter?: boolean;
        readonly containsNonAlphanumericCharacter?: boolean;
    };

PasswordPolicy.enforcementState

The enforcement state of the policy. Can be 'OFF' or 'ENFORCE'.

Signature:

readonly enforcementState: string;

PasswordPolicy.forceUpgradeOnSignin

Whether existing passwords must meet the policy.

Signature:

readonly forceUpgradeOnSignin: boolean;