Password field on a Custom Entity - how to enforce password requirements

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Rubedizzle
    Junior Member
    • Apr 2025
    • 1

    Password field on a Custom Entity - how to enforce password requirements

    Hello folks.

    We are working on a project for a client with a custom entity 'Members' (CMembers). We built a integration between EspoCRM and a Wordpress Website that housed much of the member data previously, so the EspoCRM API is used for updates from Wordpress, and Webhooks are used for updates from EspoCRM to Wordpress. This is working well. Members can be created and updated from EspoCRM and appear in Wordpress, and vice versa.

    One workflow we are trying to implement is the ability for a password to be specified in EspoCRM for a Member (as a field of type: password, or at least visually with asterisks), and then send this password over to Wordpress to update the user's account password on the website. We followed this video to add the 'password' field type to the Member entity: https://www.youtube.com/watch?v=jsAlr5yAUNo - and this worked. However we are having trouble implementing in password requirements on this field. We attempted to do this using RegEx on the entityDefs/CMember.json file, but no success unfortunately, any password length and type is accepted.

    Code:
        "fields": {
            "password":{
                "type": "password",
                "audited":true,
                "validation": {
                    "regex": "/^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d).{8,}$/",
                    "message": "The field must be at least 8 characters long and include at least one uppercase lett>
                }
            },
    We also tried playing with the EspoCRM Admin Settings Password section, but this doesn't seem to apply.

    Ultimately we want to implement minimum 8 character length, and require upper and lower case letter, and a number.


    Any suggestions on how best to accomplish this?

    Thank you!
Working...