Hey @lvelve,
Can I map both user and email from Worpdress to the email field in external database? So email becomes username in wordpress, too?
I believe you can. I had another user in this forum that I believe did exactly that ??
Is the password hash in wordpress updated when the hash changes in external database? Or can I do that with a hook?
Every time the user logs in it updates the hash in the WordPress database which is generated from the new password.
Is there a hook on password change in wordpress to update the password in the external database too?
WordPress has a hook that you could tie into. At that point you could write a query to target your external database to update the field.
Quick Clarification on Hashes
I’m sure you’re aware of this but just wanted to make sure you’re happy with this. The hash that is stored in your external database will not necessarily be the same as the hash stored in WordPress as they likely use different hashing algorithms.
They will of course both authenticate a user with the same password.
If you want to store the correct hash in the external database you will have to either:
- Generate the hash in the exported format for the external database within that WordPress hook and then update the hash in the external DB with that
- Send the plain text password to the external system and let it generate the hash using the system it already uses
As always, be super careful with any of this stuff as you don’t want to leak plain text passwords in your server logs or anywhere else where they could be intercepted.
I think I’ve answered all your questions so I’ll mark this as resolved but if you have further things you need clarified feel free to post back ??
Thanks,
Tom