How to authorize paypal as 3rd party app using developer account (Sandbox)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am trying to integrate with PayPal as third party app inside my platform.
I am using developer account and got my client key and secret, I followed the guides in the following links:
List of scopes: https://developer.paypal.com/docs/log-in-with-paypal/integrate/reference/#scope-attributes
Aouth to login: https://developer.paypal.com/docs/log-in-with-paypal/upgrade/
https://developer.paypal.com/docs/log-in-with-paypal/integrate/
The thing is the aouth link "https://www.sandbox.paypal.com/signin/authorize" responds with => StatusCodeError: 401 - {"error":"invalid_client","error_description":"Client Authentication failed"} .. Could anyone help me with this?
Here is the authentication model I am using:
scope : [ 'openid' , 'profile' , 'email' ],
scopeDelimiter : ' ' ,
accountNameFromProfileInfo : context => {
return context . profileInfo [ 'name' ] || context . profileInfo [ 'user_id' ]. toString ();
},
authUrl : 'https://www.sandbox.paypal.com/signin/authorize' ,
// authUrl: context => {
// return 'https://www.sandbox.paypal.com/signin/authorize?' +
// `response_type=code&client_id=${context.clientId}` +
// `&flowEntry=static` +
// `&redirect_uri=${context.callbackUrl}`
// },
requestAccessToken : context => {
// don't put params into post body, won't work, have to be in query
let tokenUrl = 'https://api-m.sandbox.paypal.com/v1/oauth2/token?' +
'grant_type=authorization_code&code=' + context . authorizationCode +
'&redirect_uri=' + context . callbackUrl +
'&client_id=' + context . clientId +
'&client_secret=' + context . clientSecret ;
return request ({
method : 'POST' ,
url : tokenUrl ,
headers : {
'Content-Type' : 'application/x-www-form-urlencoded'
},
json : true
}). then ( result => {
console . log ( '[[[[[[[Token Result]]]]]]]:' , result );
profileInfo = result [ 'data' ];
let newDate = new Date ();
newDate . setTime ( newDate . getTime () + ( result [ 'expires_in' ] * 1000 ));
return {
accessToken : result [ 'access_token' ],
//refreshToken: result['refresh_token'],
accessTokenExpDate : newDate
};
});
},
I have tested the accessToken request through postman using my client key and secret, and it's generated successfully. My issue now how to authorize a login through my platform using developer account?
Thanks in advance,
Aya [removed]
Full Stack Developer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- NOT ENABLED TO VAULT PAYMENT SOURCE in Sandbox Environment
- Paypal 3DS intigration error in NVP/SOAP APIs
- Inquiry About Documentation and Support for Tokenization and Future Payment in Payflow
- PERMISSION_DENIED trying to refund capture in live mode in REST APIs
- I can't login in Sandbox mode (to link Reculry to Paypal) in Sandbox Environment