Skip to main content

PayPal Community

  • Dashboard
  • Send and Request
  • Wallet
  • Business
  • Help
Log in

Le Forum de la communauté n’est pas disponible pour les nouveaux messages ou les réponses; les articles précédents restent disponibles pour vérification. Afin de connaître les options d’assistance complètes, rendez-vous sur PayPal.com/HelpCenter

Si vous souhaitez signaler du contenu illégal et contraire au Règlement sur les services numériques de l’Union Européenne (DSA), veuillez cliquer ici.

since ‎May-05-2022
Country: India
Type: Business
Aneek
Aneek Contributor
Contributor
1
Post
0
Kudos
0
Solutions
Active
The Return
View all
Latest Contributions by Aneek
  • Topics Aneek has Participated In
  • Latest Contributions by Aneek

How to authorize paypal as 3rd party app using dev...

by Aneek Contributor in Sandbox Environment
‎May-05-2022 06:26 AM
‎May-05-2022 06:26 AM
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 ... View more
Labels:
  • Labels:
  • API
  • Payflow
  • REST
Paypal Logo
  • Help
  • Contact Us
  • Security
  • Fees
  • © 1999-2025 PayPal, Inc. All rights reserved.
  • Privacy
  • Legal
  • Cookies
  • Policy Updates

The money in your balance is eligible for pass-through FDIC insurance.

The PayPal Cash Mastercard is issued by The Bancorp Bank pursuant to a license by Mastercard International Incorporated. The Bancorp Bank; Member FDIC.

Powered by Khoros