cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Discuss Dropbox Developer & API

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Dropnbox for Moodle

Dropnbox for Moodle

Freddy shaddy
Explorer | Level 4

Hello,

 

I am using Moodle platform for online teaching. I was trying to connect my Dropbox account to my Moodle website. Everything was normal during the process. I put both API & Secret Key from dropbox into my moodle, and put OAuth 2 Redirect URI into dropbox and everything was fine. Since the permission type is Scope App I have checked every boxes in permission section. now when I check dropbox in my moodle for like uploading a file, I need to login to my dropbox from moodle, this is where I get an error. Error 400 saying that "No scope requested can be granted for this app.". Would you please help me? thanks

 

000.JPGMy Moodle SettingMy Moodle Setting002.JPG003.JPG

9 Replies 9

Greg-DB
Dropbox Staff

Could you share the full URL of the page showing that "Error (400)" so we can check on this for you? Feel free to open an API ticket if you'd prefer to share privately. Thanks in advance! 

Greg-DB
Dropbox Staff

Thanks! That's helpful. While your app is registered for all scopes, that authorization URL includes the "scope" parameter but doesn't actually specify any scopes to use, leading to that error.

 

The app should specify just the scopes it needs on that authorization URL. You may want to check with the developer of the app to see why it isn't doing that, or have them update it to set that properly.

 

To work around this though, if you just want to authorize all of the scopes you enabled for the app, you can do so by removing the "&scope" from the end of the URL.

 

We do recommend only enabling and authorizing the specific scope(s) needed for the app though. And, if you're not a Dropbox Business admin and don't want to connect an entire team, you'll also want to disable any "team" scopes you enabled for the app first.

Freddy shaddy
Explorer | Level 4

Dear Greg

Thank you for your reply. I worked but there are still some difficulties. I was wondering if there is also a solution for that.

when I get the Error 400, I have to copy and paste the link into a new tab because the Error's tab does not allow me to change the URL. So I have to copy & paste the URL into a new tab then I can sign in and access my files. Furthure more, I have to do this everytime I need to use my dropbox via moodle app :))) and it time consuming and really a pain. 

Здравко
Legendary | Level 20

Hi @Freddy shaddy,

Where are you generating these URLs? You shouldn't change already generated URL by hand, but have to correct the code in a way the "scopes" field doesn't participate anymore.

Hope this adds clarity to @Greg-DB description.

Greg-DB
Dropbox Staff

@Freddy shaddy Здравко is correct, this should ideally corrected in the third party app's code itself. If you're not the developer of the app, you may want to reach out to them to request they update the app accordingly.

Freddy shaddy
Explorer | Level 4

thank both of you, unfortunatelly I don't have any experience in app development related stuff. I'm not sure if I know someone who is an expert in this field. the app that I use is moodle, it is a web base learning environment. it works on wamp. do you have any information about moodle? 

Здравко
Legendary | Level 20

Hi @Freddy shaddy,

I just take a look on Moodle and there is an application specific Dropbox client; the official Dropbox php SDK isn't used. In the client is missing initialization of the 'scope' field in the class' constructor. That's the bug. 🧐😉 You can fix it yourself.

Good luck.

 

PS: A bit more help info for you.

Take a look in the "dropbox" class constructor here and find out equivalent place in your install. After that, expand the line:

    parent::__construct($key, $secret, $callback, '');

... to something like:

    parent::__construct($key, $secret, $callback, 'account_info.read account_info.write files.metadata.read files.metadata.write files.content.write files.content.read sharing.read sharing.write file_requests.read file_requests.write contacts.write');

The only change is the last constructor argument - the scope. You can tune it in addition according your preferences and @Greg-DB advices. I have just put an example value according the visible part of your settings posted.

Greg-DB
Dropbox Staff

@Freddy shaddy If you are not able to make the modification required, you'll need to reach out to the developers of Moodle for help. Dropbox can't offer help configuring and using Moodle itself, as it's made by a third party.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Здравко Legendary | Level 20
  • User avatar
    Freddy shaddy Explorer | Level 4
What do Dropbox user levels mean?