tbenyon
Forum Replies Created
-
Thatβs awesome Luc.
Sounds like youβve got it all in hand.
If it all works Iβd be grateful if you could write a review or even buy me a beer.
Keep me posted with how you get on!
Thanks,
Tom π
Forum: Plugins
In reply to: [External Login] Error:404 Could not access the server to run the test.Does your external database server allow access from the IP of your WordPress install?
I believe this is outside of the plugin and an issue with the connection details being wrong or being refused.
Can you start by double checking this.
Forum: Plugins
In reply to: [External Login] Custom hash for passwordHey @kzkggaara,
Just checking in to see how you got on and if this is resolved for you π
Forum: Plugins
In reply to: [External Login] Salted Password IssueI haven’t heard back so I’m going to mark this as resolved.
Happy to help if you have any further questions π
Forum: Plugins
In reply to: [External Login] Login / Register for two different SiteNo worries @sohom π
I’ll mark this as resolved for now but let me know if you have any more questions.
Do come back and tell me how you got on.
If the plugin does end up doing what you’re looking for, I’d be really grateful if you could write a review or even buy me a beer.
Thanks again,
Tom
- This reply was modified 6 years ago by tbenyon.
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
Forum: Plugins
In reply to: [External Login] Login / Register for two different SiteHey @sohom,
This will mostly do what you’ve said but I’d like to clarify what the plugin does to make sure it meets your needs.
The plugin will treat the user details in the PHP database as the single form of truth. Every time a user logs into the WordPress database, the details from the external database (PHP site in your case) get created / updated in WordPress. You need to have a user in WordPress created for the site to function properly.
If you make changes to a user in WordPress they do not get synchronised back to your PHP database.
I think this meets your needs but let me know if you have any other questions π
Thanks,
Tom
Forum: Plugins
In reply to: [External Login] User role changes when existHey @kzkggaara,
As I suggested to @deqko, I could put a custom hook in that would allow you to customise what data is saved for the user so you can add your own logic.
If you get your login working from your other post and feel this would be useful I’ll start looking at adding the feature and writing you a bit of pseudocode that would get you started and allow you to customise this further.
Let me know your thoughts π
Thanks,
Tom
Forum: Plugins
In reply to: [External Login] Custom hash for passwordHey @kzkggaara,
This is very possible for the plugin. For users that have a custom hashing algorithm you can validate the password in your own way.
If you look on the FAQ section on the main page there is a part about custom hooks.
In there I document how to use a custom hash by using the exlog_hook_filter_authenticate_hash filter.
In your case, adding the following block of code to your functions.php file should solve the problem for you…
function myExlogHashAuthenticator($password, $hashFromDatabase, $username, $externalUserData) { $generatedHash = sha1(strtoupper($username.":".$password)); return $hashFromDatabase == $generatedHash; } add_filter('exlog_hook_filter_authenticate_hash', 'myExlogHashAuthenticator', 10, 4);I haven’t tested this, it is just pseudocode but it should give you the basis of what you need.
Do come back and tell me how you got on π
Forum: Plugins
In reply to: [External Login] Salted Password IssueHey @jonah0037,
Just checking in to see how youβre getting on π
Forum: Plugins
In reply to: [External Login] 500 error with postgresHey @jeremylopez,
Apologies for the delayed reply. Life has been particularly busy at the moment.
I had no idea it was possible to host a PostGres database on S3? Not sure if you meant something else or you’re going to teach me something π
My hunch is this will be a permissions error with AWS or a missing plugin required on your WordPress server for PostGres.
If you want to do more debugging you can add additional error logs in the database section of the plugin to help find the error for your connection.
Have a look in this file:
…/plugins/external-login/login/db.phpThe main function is
exlog_auth_query(). You can follow the logic from there and add in additional error logs to spot your problem.I would like to add a feature where we can turn on verbose logging at some point – when life gets less busy! π
Let me know how you get on,
Thanks,
Tom
Forum: Plugins
In reply to: [External Login] Support for Redmine password hashHey @jamasi,
Great job on getting it sorted!!! π
Also very much appreciate you sharing your solution for the next developer who comes along π
If you get a minute, Iβd be grateful if you could write a review or even buy me a beer.
Thanks again,
Tom π
Forum: Plugins
In reply to: [External Login] Cells wrong format? Connects but no loginHi @samuelskidmore,
Apologies for the delayed response.
This is partially possible with the plugin. The only caution is with your use of the word ‘sync’. It will allow users to login to WordPress with the users in your external database however it will not sync changes made in WordPress back to your database.
Thanks,
Tom
Forum: Plugins
In reply to: [External Login] Salted Password IssueHey @jonah0037,
Because this is a custom hashing solution some custom code is required to hook into the plugin flow.
You can do this with the βexlog_hook_filter_authenticate_hashβ hook. You can find documentation for its use in the FAQ.
To help you out however, this is something like what you would want to add to your functions.php file:
function myExlogHashAuthenticator($password, $hashFromDatabase, $username, $externalUserData) { $timeLoginStamp = $externalUserData['yourFieldNameHere']; $computedHash = md5($timeLoginStamp . $password); return $computedHash == $hashFromDatabase; } add_filter('exlog_hook_filter_authenticate_hash', 'myExlogHashAuthenticator', 10, 4);This is just pseudo code to help you build a solution.
If any of this doesn’t make sense, please get back to me and I’ll answer more questions π
Let me know how you get on!
Thanks,
Tom
Forum: Plugins
In reply to: [External Login] API Validation not user loginHi @millesm,
So little of the plugin handles what you need and it’s quite a custom thing you’re looking for. I’d recommend you have read of this article (which is what I based the plugin on).
Yours will be super simple with just a basic API request and can all be handled in one file.
I’ll mark this as resolved for now as this is outside the scope of the plugin and I hope I’ve pointed you in the right direction.
I’d love to hear how you get on, and if you have any more questions feel free to post back here also π
Thanks,
Tom