Invalid return invalid client_id or redirect_uri

Viewed 946

Currently i'm trying to connect with paypal oauth login on my web app. However I'm getting this error

enter image description here

The clientside code

<script src="https://www.paypalobjects.com/js/external/connect/api.js"></script>
<script>
  paypal.use(["login"], function (login) {
    login.render({
      appid:
        "<I took from the client id>",
      scopes: "openid profile email address",
      containerid: "cwppButton",
      responseType: "code",
      locale: "en-us",
      buttonType: "CWP",
      buttonShape: "pill",
      buttonSize: "md",
      fullPage: "true",
      returnurl: "http://127.0.0.1:8080/paypal-return",
    });
  });
</script>

The clientID

enter image description here

The return URL

enter image description here

Is there anything that I missed here, I couldn't find the error that is pointing in the right direction.

Thanks

1 Answers

With the following code it works for me. I had the same issue and included this: "authend": "sandbox" Full code:

    <span id='lippButton'></span>
    <script src='https://www.paypalobjects.com/js/external/api.js'></script>
    <script>
        paypal.use( ['login'], function (login) {
            login.render ({
                "appid":"<MY APP ID>",
                "authend": "sandbox",
                "scopes":"openid",
                "containerid":"lippButton",
                "responseType":"code",
                "locale":"en-us",
                "buttonType":"LWP",
                "buttonShape":"pill",
                "buttonSize":"lg",
                "fullPage":"true",
                "returnurl":"http://127.0.0.1/CyFlying/public/"
            });
        });
    </script>
Related