Hey Rene,
I vaguely remember starting to work on something for someone a long while ago but they suddenly dropped off the radar. It is not a feature I’m excited about writing to be honest. I’m concerned that it adds risk as it would be the first feature to do any writing to the external database.
It gets more complicated as we’re starting to talk about syncing. At the moment, when you login to WordPress we create (or update) a user from the external database in WordPress’ database. Every time the user logs in from the external database we update the information. That does mean that if a user updates their password on the external system it doesn’t immediately update in WordPress – only when they next try to login. If the external password is unobtainable, due to a failed request or the database being down, the user is then able to login to WordPress with the old password. This is why I added the disable local login feature for those that want to prevent local login and ensure that the user is always using the password in the external database.
I think I would similarly have to enforce the use of this strict link to do this as, if a password change was requested in WordPress I would first have to make sure that the password matched the requirements in WordPress and then firstly update it in the external database, ensure that was successful before updating in WordPress. Otherwise if the request failed we’d have passwords out of sync.
It also raises the question of if other information (such as e-mail address) is updated in WordPress, should this be synced. This adds a lot more complexity which I won’t go in to now. At the moment, any of the data that is pulled from the external database will always write over what is in WordPress when the user next logs into WordPress.
As another thought if both WordPress and the External Database are currently in use – often the external database will have a reset password flow. A tidier solution for some users would be to modify the reset password feature within WordPress and replace it with a button that links the user to the external systems reset password flow. This is better in a lot of ways as this means only one reset password flow is managed. There are different ways to reset a password so it is probably best to only have one system handle this. I could understand however that some people would rather have WordPress be the way to handle this.
Wow I’ve really rambled at you ?? Apologies. This was mostly me just thinking out loud regarding how this would even be tackled but I wanted to voice as I’d be interested in the perspective of yourself and other users.
To be completely honest, If I do work on this feature, I think it would be the first feature I would add to a pro version of the plugin due to the time it’ll take to write and support.
Please let me know your thoughts Rene,
Thanks,
Tom ??