tbenyon
Forum Replies Created
-
Forum: Plugins
In reply to: [External Login] SQLServer error connectAwesome! Let me know how you get on 🙂
Forum: Plugins
In reply to: [External Login] SQLServer error connectHey @leodm,
This is a requirement for the WordPress server.
Good luck with getting this setup and let me know how you get on 🙂
If you have any other questions feel free to get in contact 🙂
Thanks,
Tom
Forum: Plugins
In reply to: [External Login] External login and wpforoHey @vynnus,
Having the users registered as a duplicate in the WordPress database is exactly how this plugin works for that very reason. If the user changes in the external database, next time they login, we update that users details in WordPress.
It is likely you won’t need any code in your functions.php file and you can set this all up from the plugins settings page.
Just put in the details to be able to connect to the custom mssql database that the subdomain uses.
If you have any further questions, let me know.
Thanks,
Tom 🙂
Forum: Plugins
In reply to: [External Login] User role changes when existHaven’t heard back from you for a while so I’m going to assume this is not required.
If not, don’t hesitate to get back in contact and we’ll see what we can do 🙂
Thanks,
Tom 🙂
Forum: Plugins
In reply to: [External Login] External database just as a “first time check”Hey @fefo1983,
Haven’t heard back from you for a while so I’m going to assume this is resolved.
If not, don’t hesitate to get back in contact and we’ll see what we can do 🙂
Thanks,
Tom 🙂
Forum: Plugins
In reply to: [External Login] Can’t LoginHaven’t heard back from you for a while so I’m going to assume this is resolved.
If not, don’t hesitate to get back in contact and we’ll see what we can do 🙂
Thanks,
Tom 🙂
Forum: Plugins
In reply to: [External Login] Cant loginHey @dmsaurabh,
Haven’t heard back from you for a while so I’m going to assume this is resolved.
If not, don’t hesitate to get back in contact and we’ll see what we can do 🙂
Thanks,
Tom 🙂
Forum: Plugins
In reply to: [External Login] Old Service Loops Through Hashing 20 TimesHey @vcomgrp,
Haven’t heard back from you for a while so I’m going to assume this is resolved.
If not, don’t hesitate to get back in contact and we’ll see what we can do 🙂
Thanks,
Tom 🙂
Forum: Plugins
In reply to: [External Login] Support for Redmine password hashHey @vynnus,
Haven’t heard back from you for a while so I’m going to assume this is resolved.
If not, don’t hesitate to get back in contact and we’ll see what we can do 🙂
Thanks,
Tom 🙂
Forum: Plugins
In reply to: [External Login] External login and wpforoHey @vynnus,
Haven’t heard back from you for a while so I’m going to assume this is resolved.
If not, don’t hesitate to get back in contact and we’ll see what we can do 🙂
Thanks,
Tom 🙂
Forum: Plugins
In reply to: [External Login] External login and wpforoHey @vynnus,
From what I’ve read briefly, wpforo is just a plugin but it is installed on a normal WordPress install.
For this reason, I am assuming that you have a WordPress site with this plugin already installed. You are now creating another WordPress site which you want to be able to login to using the users stored in the first (using External Login to do so).
Assuming this is the case, although I’ve never used it, multi-site may be a better option for you. If however, you’ve already disregarded this as not working for what you want to do this plugin may help you.
In this situation you will not need any additional code in your functions.php file. You will just need to use the
phpassoption for your hashing algorithm and setup the rest of the plugin settings.Thanks,
Tom
Forum: Plugins
In reply to: [External Login] Support for Redmine password hashHey @jamasi,
for someone who is not into wordpress code that much the documentation could be a little more verbose.
You’re right that the documentation is aimed at people who already know and use WordPress. It’s always a balance of getting the right level of detail but I will take on your feedback.
Also info on where to put his hook would be needed as putting custom code into the functions.php of the theme seems to be discouraged in general.
Functions.php is an ok place to put code. Unless you want to learn more WordPress I would encourage it. If you want to Google it, my personal belief is that best practice in most situations like this would be to create a custom plugin and add this to the mu-plugins directory so that it is code that does not need to be activated (and can’t be deactivated) in the admin area. How far you want to go in your learning is your call.
I appreciate this is daunting but how these things work is not in the scope of this plugin. There are many forums and guides out there to teach these basics. Alternatively, there are plenty of developers who would happily take on the paid work if you need support beyond what the plugin is doing.
I think your code will not work, as the salt is coming from another column of the DB table and thus it is per user.
As I think you later realised I added a line that should do what you want to achieve.
$user_specific_salt = $externalUserData[$db_data["dbstructure_salt"]];
Make sure however you you set the field mapping in the External Login settings for the salt field.After digging into the source of wordpress, I suppose, [your code]
should work. Still I wonder what settings to use in the configuration page to activate it.Any code you put in functions.php will run with every request to the site, including when someone tries to login and the plugin is used.
Sorry to be a nuisance, but how can I debug if the hook is installed? So far I get correct looking data from the connection test, but I cannot login with any user.
You can add error_logs in php to output data. The tricky thing is finding exactly where they will output to on your setup. You will have to investigate this yourself as there are so many variables that will be factor.
To help make sure you have some logs showing I would recommend adding the following lines to the top of your functions.php file. If you can see these logs, you can then start adding similar lines elsewhere to check values and see if the code reached certain points:
error_log(var_export('EXLOG START!!!!', true)); $someTestData = 'quick test'; error_log(var_export($someTestData, true)); error_log(var_export('EXLOG END!!!!', true));I would expect to see the following three outputs in your PHP error logs:
EXLOG START!!!! quick test EXLOG END!!!!I hope all of this helps,
Tom
Forum: Plugins
In reply to: [External Login] Can’t LoginThere are lots of variables that can make these errors show. They’ll be stored in different places in different standard setups. I’m afraid this is something you’ll have to Google and play around with.
Forum: Plugins
In reply to: [External Login] Can’t LoginThe following line tells us the plugin is running. It is only a warning (that I’m aware of) but will not break anything.
PHP message: PHP Notice: Undefined index: exlog_authenticated in /var/www/community/wp-content/plugins/external-login/login/authenticate.php on line 30The following line is probably an issue because it is throwing an error.
2020/04/18 16:19:33 [error] 27699#27699: *5903 FastCGI sent in stderr: "PHP message: PHP Warning: pg_query(): No PostgreSQL link opened yet in /var/www/community/wp-content/pg4wp/driver_pgsql.php on line 139This is not to do with the plugin as far as I’m aware as it is in
/var/www/community/wp-content/pg4wp/driver_pgsql.php.The fact that you didn’t see any of the other logs I suggested you add makes me thing that the plugin failed to authenticate the user but the hook may not be running.
Add an addition error_log at the start of your functions.php file and see if you can see that in these logs when you log in.
You could also add another one at the start of the plugin file if that is showing.
Let me know how you get on 🙂
Forum: Plugins
In reply to: [External Login] Can’t LoginHey Julian,
Looks like you’ve made a good start.
I’ve added in some suggested error logs to help you and also put a couple of comments in place that may help you debug. The comments are regarding:
- There’s 2 or 3 functions that you’re using that I’m not sure if they do or don’t exist on this server.
- At one point you store some data in a variable $hash, never use it then write straight back over the top of it.
Here’s the code with comments and logs:
function myExlogHashAuthenticator($password, $hashFromDatabase, $username, $externalUserData) { error_log('EXLOG START >>>>>>>>>>>>>>>>>>>'); $hashedPassword = strtoupper(md5($password)); $staticKey = 'houdini'; error_log('EXLOG hashed PW'); error_log(var_export($hashedPassword, true)); // Does this function exist in your wordpress install??? $flashClientHash = getLoginHash($hashedPassword, $staticKey); error_log('EXLOG FLASH'); error_log(var_export($flashClientHash, true)); $datbasePassword = password_hash($flashClientHash, PASSWORD_DEFAULT, [ 'cost' => 12 ]); error_log('EXLOG $datbasePassword'); error_log(var_export($datbasePassword, true)); $password = md5($password); error_log('EXLOG password md5'); error_log(var_export($password, true)); // YOU DON'T SEEM TO USE THIS DATA ANYWHERE AS YOU CHANCE IT's VALUE BELOW??? $hash = substr($password, 16, 16) . substr($password, 0, 16); // Does this function exist in your wordpress install??? $hash = encryptPassword($password, false); $hash .= $staticKey; $hash .= 'Y(02.>\'H}t":E1'; $hash = encryptPassword($hash); error_log('EXLOG Comparison Values?'); error_log(var_export($hash, true)); error_log(var_export($hashFromDatabase, true)); error_log('EXLOG VALID PASSWORD?'); error_log(var_export($hash == $hashFromDatabase, true)); error_log('EXLOG END >>>>>>>>>>>>>>>>>>>'); return $hash == $hashFromDatabase; } add_filter('exlog_hook_filter_authenticate_hash', 'myExlogHashAuthenticator', 10, 4);Have a look at your error logs and then you can check to make sure your hook is running, and see what is happening at each stage so you can see what doesn’t match up with what is happening on your other server.
Let me know how you get on 🙂
Thanks,
Tom