Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dropbox API Chooser with JS from localhost: Origin does not match any app domain

I try to get access to my dropbox app from localhost to download images from there. The popup for the chooser appears, but I get an error:

Origin does not match any app domain

SCRIPT

 <div id="container"><a id="link"></a></div>


<script>
  var button = Dropbox.createChooseButton({
    success: function (files) {
      var linkTag = document.getElementById('link');
      linkTag.href = files[0].link;
      linkTag.textContent = files[0].link;
    },
    linkType: 'direct'
  });
  document.getElementById('container').appendChild(button);
</script>

I have included the dropins.js with the app-key, generated on dropbox.

Settings Dropbox

OAUTH2 Redirect URI is set to

http://127.0.0.1:8020/

Any ideas? I´ve still tried a lot:

  • URI without Port
  • URI with my folder .../balin-spice/
  • URI localhost in connection with a URI shortener
like image 931
mm1975 Avatar asked Dec 25 '22 08:12

mm1975


1 Answers

There should be a section in the App console (https://www.dropbox.com/developers/apps/info/...) called "Drop-ins domains." Make sure to add all the domains you're going to use there. (It looks like you probably need to add 127.0.0.1 and/or localhost.)

like image 150
user94559 Avatar answered Dec 28 '22 06:12

user94559