Pro API For Remote Operations - auth_check_user not working

I was using the auth_check_user php script with no issues until all of a sudden it stopped working and would not authenticate users. Nothing was changed on server or wordpress. I can still use get_user or other scripts with no issues. However I cannot figure out why auth_check_user doesnt work and why it stopped working out of nowhere. Any help would be greatly appreciated!

WordPress have a new version, autoupdated, maybe this is the problem?

It happened before the update.

Which update? There is the very recent update to 4.8.3, but the update to 4.8.2 was not long ago and concerned the same issue.

I have just tried the auth_check_user script and it worked for me. I did notice, however, that it messed up something to do with WordPress’s own REST API. So I wonder if that’s the problem (in which case, maybe you’d be better off switching to the REST API instead).

The issue was with 4.8.2. The bizzare part was that it would work and then stop working out of nowhere, without any changes to the script or wordpress. It seems to work now with 4.8.3. Also what was bizzare is that other api scripts worked just fine while auth_check_user wasnt working. Thanks for the tip on REST API. I will try it if I run into issues again. I will report here if I do.

It happened again with 4.8.3. It works working fine for a few days and then boom it stops working completely. No changes on the server or within wordpress. It doesnt make any sense. Its really frustrating because I rely on the script to authenticate users outside of wordpress. Any input on this is appreciated!

The worst part is that the script works fine for a while but then I wake up the next day to a bunch of angry emails about not being able to log in. Anyone else experience anything similar? There has to be a logical explanation to this.

I am actually having the same problem trying to get a filter to work with the WP REST API. It was working fine last night, but today it doesn’t work at all.

So now I’m thinking that I was wrong when I thought that the s2Member API was interfering with the WP REST API. My current supposition is that there is something else going on that is affecting both APIs. But I have no idea what that might be.

Having no error code to work with and having it work at one point and then not at another makes it really hard to figure out. If you find a solution let me know, I will do the same.

I hear you! One of the reasons why I am using the REST API is because there is a plugin that logs the error codes. But this particular problem is proving extremely difficult to resolve precisely because, for some reason, I am not seeing any error codes.

I will certainly report back if I find anything helpful.

One thing you might like to try is replacing the code for the following two variables with this code:

$post_data = array( 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => 's2member_pro_remote_op='.urlencode( json_encode( $op ) ) );
$result    = json_decode( wp_remote_retrieve_body( wp_remote_post ( 'https://yoursite.com/?s2member_pro_remote_op=1', $post_data ) ), true);

In my case, I’ve worked out that I one of my REST API requests is causing a conflict with the other two. Once I deactivate that one, the other two work immediately. So my taks is to work out how to make the third work without interfering with the others.

Thanks, I will give that a try. My workaround at the moment is to just authenticate via wordpress:
require("/var/www/html/wp-load.php");
if(wp_check_password($pass, $user->data->user_pass, $user->ID)) echo ‘authenticated’;

The only downfall of this approach is that it is potentially vulnerable to brute force attacks. I will try what you recommended, hopefully that solves it. Thanks!