Can’t log in | Password Hashing
-
Hi,
I want to share users between 2 WordPress (5.03) websites: A (users DB) and B (no users).
I have managed to connect the dababase A to B (both on thesame server)
Unfortianetly I can not login in B. I have tried bcrypt, Md5, ssh1 but they are not working.
Where can I find Password Hashing of B and how to set it up? Wpconfig? How to use it?
Thank you!
-
Hey @piska,
Before we start debugging the use of my plugin for this, I think you would be much better off looking at WorsPress multisite.
Apologies if there’s a reason you’ve already diregarded this solution.
Here’s a link I got from a quick Google:
https://wpengine.co.uk/resources/wordpress-multisite-user-management/If it’s no what you’re looking for come back to me.
Thanks,
Tom
Hi,
Thank you for your replay! WordPress multisite is not a solution for me because they all using the same (one) database.
I need a solution for 2 websites on 2 different hostings, 2 different databases.
Do I need to use one of these from the website A?
define(‘AUTH_KEY’, ‘put your unique phrase here’);
define(‘SECURE_AUTH_KEY’, ‘put your unique phrase here’);
define(‘LOGGED_IN_KEY’, ‘put your unique phrase here’);
define(‘NONCE_KEY’, ‘put your unique phrase here’);
define(‘AUTH_SALT’, ‘put your unique phrase here’);
define(‘SECURE_AUTH_SALT’, ‘put your unique phrase here’);
define(‘LOGGED_IN_SALT’, ‘put your unique phrase here’);
define(‘NONCE_SALT’, ‘put your unique phrase here’);Ok, apologies for slowing down this process for you, I just worried we were going to waste your time by looking at the wrong solution.
To get one thing solved at a time, let’s not worry about the plugin being installed on site A at the moment. Let’s just get Site B logging in using Site A users. For this we don’t even need the plugin installed on site A but just leave it there for now.
On site B, try setting the hashing method to “phpcrypt” or “phpass”.
I’m pretty sure WordPress uses one of these by default.
Let me know how you get on 🙂
Websites A and B are on 1 server now (for testing). So used “Localhost” and “phpass” in the setting. It is working now!
But want to have them at different hostings.
Unfortuinally I get 500 error when I hit Test connection:(
I added the IP of B via Extern Mysql via cPanel but still now working (not sure if it nedeed). I’m on a shared hosting.
PS: Your plugin is just what I need! I will definatly buy you a beer!
Hey @piska,
Apologies for the delayed response.
The 500 should mean that you have got a connection to the server but it is returning an error.
Two things we can do:
1) PHP error logs
You are hitting the test button on site A and getting the 500 error. Can you please get me the PHP errors for site B that occurred at the time you clicked the Test button.2) Get more information from the front end JS error
If you’re able, can you replace all the code in this file (/wp-content/plugins/external-login/js/exlog_test.js) on site A.
Could you please delete the previous code paste the following code in there instead.
console.log("EXLOG - Test file loaded."); (function ($) { $(function () { console.log("EXLOG - Test file loaded jQuery."); var $modal = $(".exlog_modal"); var $loader = $(".exlog_loader_container"); var $modal_content_container = $(".exlog_test_results_inner_container", $modal); var $modal_test_results = $(".exlog_test_results", $modal); var $modal_error = $(".exlog_test_fail", $modal_content_container); var $modal_error_title = $(".exlog-error-title", $modal_error); var $modal_error_message = $(".exlog-error-message", $modal_error); var wordpressBaseUrl = $('[data-exlog-wp-base]').attr('data-exlog-wp-base'); var error_messages = { unknown: { title: "Error", message: "This is an unknown error." }, lost: { title: "Error", message: "Could not access the server to run the test." }, server: { title: "Error", message: "There was an error on the server." }, empty_result: { title: "Error", message: "No data returned from the server. Please check your settings." } }; var error_codes = { 100: error_messages.unknown, // Ajax returned, unknown error 101: error_messages.unknown, // Unknown error passed to error handler 404: error_messages.lost, // 404 from Ajax 500: error_messages.server, // 500 from server - see test_results.php? 501: error_messages.server, // String of "0" returned - caused by missing function? 502: error_messages.server, // 500ish error from Ajax 600: error_messages.empty_result, // Empty AJAX response 601: error_messages.empty_result // Blank string AJAX response // 999: ???????????????????????? // Hard coded in markup case this system fails }; function errorMessageState(error_code) { if (!error_code) { $modal_error.hide(); } if (!error_codes.hasOwnProperty(error_code)) { error_code = 101; } var error_data = error_codes[error_code]; $modal_error_title.text(error_data.title + ": " + error_code); $modal_error_message.text(error_data.message); $modal_error.show(); } $(".exlog_close_button", $modal).click(function () { $modal_error.hide(); $modal.hide(); $modal_test_results.text(""); }); $("input.exlog_test_connection").click(function () { console.log("EXLOG - Test button clicked."); $modal.show(); $loader.show(); var data = { 'action': 'exlog_test_connection', 'test_results': 10 }; console.log("EXLOG - About to make request."); $.ajax({ type: "GET", url: wordpressBaseUrl + "/wp-admin/admin-ajax.php", data: data, success: function (data) { if (typeof data === 'string') { data = data.trim(); } if (!data) { console.log("EXLOG - NO DATA"); errorMessageState(600); $modal_error.show(); } else if (data == "") { console.log("EXLOG - EMPTY STRING DATA"); errorMessageState(601); $modal_error.show(); } else if (data === "0") { errorMessageState(501); } else { console.log("EXLOG - SUCCESS!!! WHOOP!"); $modal_error.hide(); $modal_test_results.append(data); } $loader.hide(); }, error: function (xhr, ajaxOptions, thrownError){ console.log("EXLOG - Request fail!!!"); console.log("Status: ", xhr.status); console.log("Response Text: ", xhr.responseText); if(xhr.status == 404) { errorMessageState(404); } else if (xhr.status === 500) { errorMessageState(500); } else if (Math.floor(xhr.status / 100) === 5) { errorMessageState(502); } else { errorMessageState(100); } $loader.hide(); } }); }); }); }(jQuery));Can you then open the inspector and look at the browsers console.
I’m interested particularly to see the output that follows “Response Text: “.
Thanks,
Tom
Sorry – I made a wrong comment about step one, please do this instead:
1) PHP error logs
You are hitting the test button on site A and getting the 500 error. Can you please get me the PHP errors for the site you are hitting the test button on (site A) that occurred at the time you clicked the Test button.I’m presuming this is resolved as I haven’t heard back so I’m going to mark this as so.
If this is not the case, please feel free to get back to me and we’ll continue to look into this for you.
Thanks,
Tom 🙂
The topic ‘Can’t log in | Password Hashing’ is closed to new replies.