Why do I get 401 Unauthorised error when calling Get user info API?

minh-nguyen
Contributor
Contributor

I was following this guide to integrate the "Login with PayPal" button on our website: https://developer.paypal.com/docs/log-in-with-paypal/integrate/.

However, I ran into an issue at step 5: "Get customer info." The API returned a 401 Unauthorized status code, even though I used the access token provided by the token service endpoint in step 4.

Does anyone know why this might be happening or how to resolve it?

Login to Me Too
1 REPLY 1

mondev
New Community Member

I'm encountering the same issue.

 

I've implemented the OAuth flow in the sandbox environment and successfully obtain an access token, but when I immediately try to call the v1/identity/openidconnect/userinfo endpoint, I receive a 401 Unauthorized error with an empty response body.


Interestingly, I've noticed that this error only occurs when using Business sandbox test accounts. When I test with Personal sandbox accounts, I can retrieve the user information without any problems.


Has anyone observed this behavior specific to Business accounts? If this might be a separate issue, I'd be happy to create a new topic for discussion. Thanks!

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.