We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9207 ☆ A M B ☆
    • 2,475 Posts
    Is there any way to force users to change their passwords? The use case I'm thinking of is after a user is created by MODX and they are emailed their password -- for security reasons, I want that password to be temporary so they can use it to log in ONE time and then they are forced to change it. If it were a column in a table, you could also update this if you had a security incident and you wanted all users to update their passwords, or it could tie into a larger password policy where you required passwords to be changed by a certain date (e.g. every 3 months).

    Related: where in the MODX is there a "generate password" function? I know there must be one in there somewhere... I saw one in the Login package, so my guess is that it's not obvious enough because people are reinventing wheels...

    I've been thinking about a good security extra that would help beef up MODX login security including 2 factor authentication and a way to enforce password complexity rules, but if I can do something easier for now, that'd be great. Anyone know of anything to force a password change?

    This question has been answered by BobRay. See the first response.

    • discuss.answer
      • 3749
      • 24,544 Posts
      The modUser object has remote_data and remote_key fields that are usually unused. I think they're for external authentication (e.g., LDAP), but if you're not using them, they're normally set to null. You could use either of them (or both) to flag the need to force a password change.

      I would be inclined to find my own password generator to make things more secure, since the MODX password generator is public code.

      https://www.google.com/search?q=php+password+generator&oq=php+password+generator

      If you let the user pick a password, there should also probably be a strength indicator and a minimum strength requirement.

      https://www.google.com/search?q=php+password+strength+meter
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 9207 ☆ A M B ☆
        • 2,475 Posts
        Thanks Bob... I think I can work with that. The generator may not be such an issue if it's just a temporary password that's issued. Ideally the users are using something like 1password to generate and store unique passwords for each site... if I went whole hog and did a 2 factor authentication, it'd cut down on the vulnerability of weak passwords anyhow.