Enzoic API - Developer Documentation
Visit our website
  • Enzoic Website
  • Getting Started
    • .NET Quick Start
    • Java Quick Start
    • JavaScript Quick Start
    • Ruby Quick Start
    • PHP Quick Start
    • Go Quick Start
    • Python Quick Start
  • Using the Enzoic API
  • Libraries
  • API reference
    • Passwords API
    • Credentials API
      • Hashed Credentials API
      • Cleartext Credentials API
        • Query Passwords for an Email Address
        • Query Passwords for a Domain
        • Query Passwords for a Partial Hash of an Email Address
      • Test Accounts
    • Exposures API
      • Get Exposures for an Email Address
      • Get Exposures for a Domain
      • Get Exposures for All Email Addresses in a Domain
      • Get Exposures by Date
      • Retrieve Details for an Exposure
    • Breach Monitoring API
      • Breach Monitoring by User
        • Add Breach Alert Subscriptions for Users
        • Remove Breach Alert Subscriptions for Users
        • Query Breach Alert Subscriptions for Users
      • Breach Monitoring by Domain
        • Add Breach Alert Subscriptions for Domains
        • Remove Breach Alert Subscriptions for Domains
        • Query Breach Alert Subscriptions for Domains
      • Webhooks
        • Managing Webhooks
          • Register a Webhook
          • Update a Webhook
          • Delete a Webhook
          • Query Registered Webhooks
        • Webhook Test API
    • Identity Breach Monitoring API
      • Monitoring Identities
        • Add Identities to Monitoring
        • Update Monitored Identities
        • Remove an Identity from Monitoring
        • Query Monitored Identities
      • Retrieving Identity Exposures
      • Webhooks
        • Managing Webhooks
          • Register a Webhook
          • Update a Webhook
          • Delete a Webhook
          • Query Registered Webhooks
        • Webhook Test API
    • BIN Monitoring API
      • Monitoring BINs
        • Add Bank Identification Numbers to Monitoring
        • Remove Bank Identification Numbers from Monitoring
        • Query Monitored Bank Identification Numbers
      • Retrieving Exposed Payment Cards
      • Webhooks
        • Managing Webhooks
          • Register a Webhook
          • Update a Webhook
          • Delete a Webhook
          • Query Registered Webhooks
        • Webhook Test API
    • Payment Card Exposures API
      • Check a Card Number for Compromise
    • Account Status APIs
      • Account Status
      • Account Usage
    • Password Hash Algorithms
    • OpenAPI Specification
    • View OpenAPI Spec in Swagger UI
    • Postman Collection of API Examples
  • Password Strength Meter
    • Quick Start
    • Example
Powered by GitBook
On this page
  • 1. Include the Enzoic JS Library
  • 2. Enable Enzoic on Your Password Input Control
  • 3. Modify Your Form Validation Logic
  • That’s it!

Was this helpful?

  1. Password Strength Meter

Quick Start

Adding the Enzoic Password Strength Meter to your existing signup or password change form is simple.

1. Include the Enzoic JS Library

Add the following script include before your closing body tag:

<script async type="text/javascript" 
            src="https://cdn.enzoic.com/js/enzoic.min.js" />

2. Enable Enzoic on Your Password Input Control

Add the “enz-enable” attribute to your signup form’s password input element:

<input type="password" enz-enable />

Alternatively, you can call the applyToInputElement function:

<script type="text/javascript">
    var passwordEl = document.getElementById('id_of_your_password_input');
    Enzoic.applyToInputElement(passwordEl);
</script>

Delete any existing password strength meter from the page, as you will no longer need it.

3. Modify Your Form Validation Logic

Add in code to prevent the user from submitting the form if the password strength is insufficient. The mechanism for alerting the user will be specific to your page, but a basic code snippet in JavaScript for this is below:

  // typically this is the onsubmit event handler for your signup form
 function formSubmit() {
 
      // check if the current password meets your desired
      // strength score (strong in this case)
      if (Enzoic.currentPasswordScore <
          Enzoic.PASSWORD_STRENGTH.Strong) {
 
          // password is not strong enough, do something
          // here to indicate to the user that they must
          // improve their password's strength before they
          // can move on
 
      }
}

That’s it!

You’re done! When you reload the page, your password input will now have the Enzoic frame around it when it is focused.

PreviousPassword Strength MeterNextExample

Last updated 2 years ago

Was this helpful?