tbenyon
Forum Replies Created
-
Forum: Plugins
In reply to: [External Login] 500 server errorHey @axharkhan,
Regarding your PBKDF2 query, I remember looking into this hash previously and finding that it wasn’t as simple as I thought it would be.
This is mostly because PBKDF2 can be implemented in loads of different ways.
This gets narrowed down a chunk if you start looking at C#s Rfc2898DeriveBytes class which pre-defines a lot of the options but also adds some complexity.
I’m not promising anything for this one as it is a lot of work to implement and I already have a bunch of jobs on the backlog.
If you could provide me with answers to the following questions it may help me weigh this up and see how quickly it could be implemented.
- Are you using the same salt for all passwords?
- Where and how are you storing the salt?
- Can you give me an example generated hash? This would preferably be created for the password
passwordand with a salt that you can also share with me.
For my reference, I’m going to include the following two links but you may also be iterested:
Forum: Plugins
In reply to: [External Login] 500 server errorRegarding your database error, it appears that this is an issue with the authentication on your MSSQL server.
There are lots of other threads that talk about these errors but it does seem to be an issue not related to the plugin.
I found Googling
sql state 28000 18456listed a bunch of suggested resolutions.If you read something that leads you to think that this may be an issue with the plugin, please let me know and I’ll be happy to look further.
Regarding your PBKDF2 request, I’ll follow this up with another comment π
Forum: Plugins
In reply to: [External Login] 500 server errorAwesome! We’re getting there!
Things I think this has told me:
- I think you’re right that mssql extension is installed as we wouldn’t have otherwise been able to get to this error
- The error being thrown is an error my end
- The error is only being thrown because the connection to the database failed. However the error is preventing us from seeing the relevant errors
There is an update I need to make here but to help you get closer to finding the issue, if you’re able to modify the code, can you make the following modification…
In:
\wp-content\plugins\external-login\login\db.php
(around line 22)
Can you change this ….if( $db_instance === false ) { error_log('EXLOG:'); error_log(FormatErrors(sqlsrv_errors())); return false; }… to this …
if( $db_instance === false ) { error_log('EXLOG:'); error_log(var_export(sqlsrv_errors(), true)); return false; }Let me know what the logs say once you’ve tried that π
Thanks,
Tom
Forum: Plugins
In reply to: [External Login] Custom User FieldsHey @rperrett,
Be careful with asking for people’s personal details. I know the moderators sometimes close peoples accounts for it.
However, really appreciate how helpful you’re being to the others π
Thanks!
Tom π
Forum: Plugins
In reply to: [External Login] Doubt about the pluginThanks for the input @bradmkjr!
Did you have any luck with Brads or my ideas of things to check?
Apologies for that brief message before I was out and only had my phone to send a quick one.
Cool, just checking as someone has just flagged a bug with MSSQL that means it won’t call the described hook. Wanted to rule this out.
May I suggest that the next step is to:
1) ensure that the external database is what is authenticating the user
– To double check this, use the setting to disable local login. That way if you do login it must be with the external database
2) ensure that the hook is getting called when a user is authenticated with the external database
– To check this I am going to suggest you put the following code in your functions.php file so that you can check the logs and make sure you can see the notes.function philengel_exlog_add_additional_user_data($wp_user, $exlog_user_data) { error_log('----------------philengel--START----------------------'); add_user_meta( $wp_user->ID, // User ID 'fav_colour', // WP Meta field key 'red', // String false // Not unique ); error_log('----------------philengel--END----------------------'); } add_action('exlog_hook_action_authenticated', 'philengel_exlog_add_additional_user_data', 10, 2);In your PHP error logs you should see two logs next to each other. This is what I saw when I just tested the code . . .
[Mon Jan 13 17:41:20.403030 2020] [php7:notice] [pid 88] [client 177.23.0.1:46688] ----------------philengel--START----------------------, referer: //localhost:8000/wp-login.php [Mon Jan 13 17:41:20.404221 2020] [php7:notice] [pid 88] [client 177.23.0.1:46688] ----------------philengel--END----------------------, referer: //localhost:8000/wp-login.phpSecondly in the
wp_usermetatable you should find ameta_keyof “fav_color” for one of the entries and that same entry will have thevaluefield stored as “red”.Let me know which of this you can’t see.
Can you please confirm which type of database it is?
-MySQL
– PostgreSQL
– mssql?Forum: Plugins
In reply to: [External Login] MSSQL & Authentication Hook ProblemHey Brad,
GREAT SPOT!
Apologies for my mistake. Really appreciate you taking the time to diagnose the problem yourself. π
I’ll get the fix in and deployed within a week for you, I’m hoping it’ll be this weekend but just can’t promise that.
Will keep you posted with updates and if you haven’t heard from me I won’t be offended if you chase.
Thanks again,
Tom
Forum: Plugins
In reply to: [External Login] 500 server errorTo help you further you would have to have a look at your php error logs on your WordPress server and look at your logs on your database server to see if you can see specific errors.
There have been a couple of solutions mentioned in this thread before but it’s hard to say what will solve your issue without you investigating your logs.
The two issues people have mentioned before for this error were:
Let me know if you find any logs or solve your problem π
Thanks,
Tom
Hey @philengel,
Apologies for the delay.
Basically to add the required functionality to the plugin, you would need to add a small bit of custom code to your functions.php file in your theme.
An example of this can be seen below.
Basically, when a user is authenticated from the external database, the function
philengel_exlog_add_additional_user_datawill get called and you get access to the new user that was created in wordpress ($wp_user) and all the data from the user table where the user name and password were stored on the external database ($exlog_user_data).In the below example I use WordPress’
add_user_metafunction to add a new meta field called ‘fav_colour’ to the WordPress database. The data I’m storing in that meta field in wordpress is from the ‘favourite_colour’ field from the external database.You could call add_user_meta() again for each of the different bits of data from that table you wanted to store.
function philengel_exlog_add_additional_user_data($wp_user, $exlog_user_data) { add_user_meta( $wp_user->ID, // User ID 'fav_colour', // WP Meta field key $exlog_user_data['favourite_colour'], // External table data false // Not unique ); } add_action('exlog_hook_action_authenticated', 'philengel_exlog_add_additional_user_data', 10, 2);If you have any further questions, don’t hesitate to get back in contact π
Thanks,
Tom
Forum: Plugins
In reply to: [External Login] The site is experiencing technical difficulties.Presume you resolved your issue but if you have any further questions don’t hesitate to get back in contact.
Thanks,
Tom π
Forum: Plugins
In reply to: [External Login] Login will just redirectAs I haven’t heard back from you I’m going to assume no more help is needed for now.
If you have any further issues, don’t hesitate to get back in contact.
π
Does this thread answer your question?
https://wordpress.org/support/topic/map-additional-field/
If any of it doesnβt make sense just ask π
Forum: Plugins
In reply to: [External Login] Password Reset/Recovery SystemReset only uses the local WordPress database. Data does NOT get written back to the external database.
You could use a hook to make this happen if you needed to in your case.
Hope this helps π
- This reply was modified 6 years, 5 months ago by tbenyon.
Hey @philengel,
Good question but I donβt believe there are any specific requirements on the database.
Can you please double check you have checkbox ticked that enables the plugin code. It is one of the first checkboxes in the settings.
If you have the next thing would be to check your php error logs for anything useful to share with me here. Please make sure you redact any private information.
If you canβt see any useful logs, Iβll add a feature to the plugin that adds additional logs to the php error logs to further help us diagnose the problem. Been meaning to add this feature for some time.
For now, as described above, check the plugin logic is enabled in the plugin setting and let me know if you can see anything useful in the current logs.
Thanks,
Tom