Search code examples
paypalpaypal-sandbox

Login with PayPal Web Implementation is not working - wrong credentials (Sandbox)


I've implemented a "Login with PayPal" button from the following site: https://developer.paypal.com/docs/log-in-with-paypal/integrate/generate-button/

For some reason I can't log in there with the generated sandbox credentials. For Pay with Paypal it works for some reason???

This is the generated Button:

    <span id='loginPaypal'></span>
    <script src='https://www.paypalobjects.com/js/external/api.js'></script>
    <script>
    paypal.use( ['login'], function (login) {
      login.render ({
        "appid":"<MY_APP_ID>",
        "scopes":"openid",
        "authend": "sandbox",
        "containerid":"loginPaypal",
        "responseType":"code",
        "locale":"de-de",
        "buttonType":"LWP",
        "buttonShape":"pill",
        "buttonSize":"lg",
        "fullPage":"true",
        "returnurl":"http://localhost:8000"
      });
    });
    </script>

Added "authend": "sandbox" by myself to refer to the sandbox.paypal.com

After clicking on the "Login with Paypal"-Button a pop up for the Login appears with following URL: https://www.sandbox.paypal.com/signin?intent=connect&ctxId=connect%3A02dce76a41e54c8a9ad0616df5c90b65&returnUri=https%253A%252F%252Fwww.sandbox.paypal.com%252Fconnect%252F%253Fclient_id%253DMY_APP_ID%2526metadata_id%253D02dce76a41e54c8a9ad0616df5c90b65%2526redirect_uri%253Dhttp%25253A%25252F%25252F127.0.0.1%25253A8888%2526response_type%253Dcode%2526scope%253Dopenid%2526context_id%253DAVAi4DheqkuNjlOqwVolmUdAVcFClixv6WDbtszYA8eIQ05GbYP8mBb9c8lB6TeCpFZkkutWIVDobTKT2022-08-06T09%25253A45%25253A18Z5oMK5bjT3JcmvHsxaMI6gw1659779118153%2526continue_acn%253Dtoken%2526redirectInContext%253Dfalse%2526flowEntry%253Dlipp_button&flowId=02dce76a41e54c8a9ad0616df5c90b65&locale.x=de_DE&country.x=DE&signup_redirect_uri=

I've used my sandbox credentials but it says "The login data entered is not correct. Please try again."

As I said before, I have also implemented Pay with PayPal and there the sandbox credentials work without problems.


Solution

  •     "returnurl":"http://localhost:8000"
    

    Make sure the Return URL corresponds to one saved and stored in the sandbox App configuration, above all the permission checkboxes. In general to save successfully it must have a fully qualified domain and use a standard port. After saving a new return URL in the app config, wait 9 hours and try again, using code with the same return URL as one that's been stored. Also make sure the Log in with PayPal section has information saved in the config, including a Privacy Policy URL and User Agreement URL (saved successfully and visible when you reload the page with the config)

    If this doesn't answer your question, you should include the full error displayed, the code with credentials you are using, and perhaps also the App configuration view.