Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

authentication issue #3

Open
harishksoft opened this issue Aug 28, 2021 · 5 comments
Open

authentication issue #3

harishksoft opened this issue Aug 28, 2021 · 5 comments

Comments

@harishksoft
Copy link

when try to authenticate using user credential, its not working and the /wishlists endpoint return error response

@prionkor
Copy link
Owner

Could you copy the error response? How are you authenticating?

@prionkor
Copy link
Owner

I see you commented on the other issue. Could you turn of WP_DEBUG and so we know what the actual error is?

@harishksoft
Copy link
Author

harishksoft commented Aug 30, 2021

Could you copy the error response? How are you authenticating?
@prionkor
i'm testing the API using POSTMAN client and using basic authentication like username and password. i also tried woocommerce consumer key and secret, but not working.
{
"code": "unauthorized",
"message": "Authentication Required",
"data": {
"code": 401,
"message": "Authentication Required",
"data": []
}
}
everytime i'm getting this error.

i have checked the code and saw that
public static function check_auth( $request ){

		if( is_user_logged_in() ) {
			return true;
		}

		return new \WP_Error('unauthorized', 'Authentication Required', [
			'code' => 401,
		'message' => 'Authentication Required',
			'data' => [],
		]);
	}

using this function to authenticate user, but don't know this will work when called from REST

@harishksoft
Copy link
Author

the endpoints /wishlist/v1 its getting responses with supporting endpoints.but actual required apis are not working

@rszwt
Copy link

rszwt commented Feb 6, 2023

Hello @prionkor
I have face same issue as mention in above response of @harishksoft .

as used is_user_logged_in() in check_auth($request) function how can API check in case of POSTMAN or real-time route?

Anyone guy's ..............................

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants