Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-70271

Dropbox: Token and Permission Updates

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Prerequisites:

      1. Create a dropbox API in Dropbox as described in https://docs.moodle.org/310/en/Dropbox_repository#Dropbox_configuration
      2. Once you have the credentials create an OAuth2 service using the guidelines here https://docs.moodle.org/dev/OAuth2_Services Additional settings -
        1. 'This service will be used' - Internal services only
        2. 'Additional parameters included in a login request for offline access. ' - token_access_type=offline
      3. Have 2 dropbox accounts:
        1. User 's1' - Dropbox Account 1
        2. User 's2' - Dropbox Account 2
      4. A moodle install with 2 users - s1 and s2.

      Testing persistent access to the repositories

      1. Log in to Moodle as s1
      2. Open private files
      3. Click 'Add...' button
      4. In the file picker window, click 'Dropbox'
      5. Click 'Log in to your account' and continue through the Dropbox log in process using your Dropbox account 
      6. Confirm log in is successful and you can see some Dropbox files listed in the Moodle repository
      7. Log out of Moodle.
      8. Repeat the repository log in process using user s2 
      9. Log out of Moodle.
      10. Log in to Moodle as s1
      11. Go to private files
      12. Click the 'Add...' button
      13. Click 'Dropbox repo'
      14. Confirm the repository automatically logs in and displays files without any prompts
      15. Now  click the 'Logout' icon.
      16. Confirm you now see the 'Log in to your account' button shown.
      17. Click back and forth between the options available and Confirm you still see the 'Log in to your account' button as you select each one.
      18. Log out of Moodle.
      19. Log in to Moodle as user s2.
      20. Go to private files
      21. Click the 'Add..' button
      22. Click 'Dropbox repo'
      23. Confirm the repository automatically logs in and displays files without any prompts
      24. Log out of Moodle.
      25. Log in to Moodle as s1
      26. Go to private files
      27. Click the 'Add..' button
      28. Click 'Dropbox repo'
      29. Confirm you see the 'Log in to your account' button
      30. Log in to your dropbox account  and Confirm you can see the files listed.
      31. Log out of Moodle.

      Revoking app access and refresh tokens

      1. Sign in to Dropbox as user s1
      2. In the top right, from the user menu, select 'settings'
      3. In the main pane, click 'Connected apps'
      4. Under 'View dropbox content' open the menu for Moodle (...) and click 'Disconnect'
      5. Now, log in to Moodle as user s1
      6. Go to private files
      7. Click the 'Add...' button
      8. Click the 'Dropbox repo' if not already selected
      9. Confirm you see the 'Log in to your account' button
      10. Log in to Dropbox repo again and Confirm you can see the Dropbox files listed.
      11. Log out of Moodle

      Upgrade test

      1. Install a new Moodle site running the latest weekly code.
        • Create the instances

          mdk create -t -v master -n imaster
          

        • Checkout the weekly commit:
          master:

          git checkout 30b8ad51f424afbc4c7a03d0d579920d0cba97dd
          

      2. In Browser 1, as an admin, run through the Dropbox setup as above - Prerequisites #1 ONLY
      3. Verify you are able to sign in to the repository
      4. In a separate browser/incognito(Browser2), log in as a student
      5. Log into your dropbox account via Private files.
      6. Checkout master

        git checkout master

      7. In Browser 1, run the upgrade
      8. Verify there are no problems during upgrade.
      9. Verify there's a new 'Dropbox' oauth2 service in Site admin -> Server -> OAuth2 services
      10. In browser 2, go to Private files and open Dropbox repository again
        1. If you are on the private files page, just refresh.
      11. Verify you are requested to log back in

      CLI Upgrade test

      1. Install a new Moodle site running the latest weekly code.
        • Create the instances

          mdk create -t -v master -n imaster
          

        • Checkout the weekly commit:
          master:

          git checkout 30b8ad51f424afbc4c7a03d0d579920d0cba97dd
          

      2. In Browser 1, as an admin, run through the Dropbox setup as above - Prerequisites #1 ONLY
      3. Verify you are able to sign in to the repository
      4. In a separate browser/incognito(Browser2), log in as a student
      5. Log into your dropbox account via Private files.
      6. Checkout master

        git checkout master

      7. In CLI, run the upgrade command

        sudo -u apache /usr/bin/php admin/cli/upgrade.php

      8. Verify there are no problems during upgrade.
      9. In browser 1, Verify there's a new 'Dropbox' oauth2 service in Site admin -> Server -> OAuth2 services
      10. In browser 2, go to Private files and open Dropbox repository again
        1. If you are on the private files page, just refresh.
      11. Verify you are requested to log back in

      Repeat Upgrade test and CLI Upgrade test, performing the dropbox setup -Prerequisites #1 and #2

      Show
      Prerequisites: Create a dropbox API in Dropbox as described in https://docs.moodle.org/310/en/Dropbox_repository#Dropbox_configuration Once you have the credentials create an OAuth2 service using the guidelines here https://docs.moodle.org/dev/OAuth2_Services Additional settings - 'This service will be used' - Internal services only 'Additional parameters included in a login request for offline access. ' - token_access_type=offline Have 2 dropbox accounts: User 's1' - Dropbox Account 1 User 's2' - Dropbox Account 2 A moodle install with 2 users - s1 and s2. Testing persistent access to the repositories Log in to Moodle as s1 Open private files Click 'Add...' button In the file picker window, click 'Dropbox' Click 'Log in to your account' and continue through the Dropbox log in process using your Dropbox account  Confirm log in is successful and you can see some Dropbox files listed in the Moodle repository Log out of Moodle. Repeat the repository log in process using user s2  Log out of Moodle. Log in to Moodle as s1 Go to private files Click the 'Add...' button Click 'Dropbox repo' Confirm the repository automatically logs in and displays files without any prompts Now  click the 'Logout' icon. Confirm you now see the 'Log in to your account' button shown. Click back and forth between the options available and Confirm you still see the 'Log in to your account' button as you select each one. Log out of Moodle. Log in to Moodle as user s2. Go to private files Click the 'Add..' button Click 'Dropbox repo' Confirm the repository automatically logs in and displays files without any prompts Log out of Moodle. Log in to Moodle as s1 Go to private files Click the 'Add..' button Click 'Dropbox repo' Confirm you see the 'Log in to your account' button Log in to your dropbox account  and Confirm you can see the files listed. Log out of Moodle. Revoking app access and refresh tokens Sign in to Dropbox as user s1 In the top right, from the user menu, select 'settings' In the main pane, click 'Connected apps' Under 'View dropbox content' open the menu for Moodle (...) and click 'Disconnect' Now, log in to Moodle as user s1 Go to private files Click the 'Add...' button Click the 'Dropbox repo' if not already selected Confirm you see the 'Log in to your account' button Log in to Dropbox repo again and Confirm you can see the Dropbox files listed. Log out of Moodle Upgrade test Install a new Moodle site running the latest weekly code. Create the instances mdk create -t -v master -n imaster Checkout the weekly commit: master: git checkout 30b8ad51f424afbc4c7a03d0d579920d0cba97dd In Browser 1, as an admin, run through the Dropbox setup as above - Prerequisites #1 ONLY Verify you are able to sign in to the repository In a separate browser/incognito(Browser2), log in as a student Log into your dropbox account via Private files. Checkout master git checkout master In Browser 1, run the upgrade Verify there are no problems during upgrade. Verify there's a new 'Dropbox' oauth2 service in Site admin -> Server -> OAuth2 services In browser 2, go to Private files and open Dropbox repository again If you are on the private files page, just refresh. Verify you are requested to log back in CLI Upgrade test Install a new Moodle site running the latest weekly code. Create the instances mdk create -t -v master -n imaster Checkout the weekly commit: master: git checkout 30b8ad51f424afbc4c7a03d0d579920d0cba97dd In Browser 1, as an admin, run through the Dropbox setup as above - Prerequisites #1 ONLY Verify you are able to sign in to the repository In a separate browser/incognito(Browser2), log in as a student Log into your dropbox account via Private files. Checkout master git checkout master In CLI, run the upgrade command sudo -u apache /usr/bin/php admin/cli/upgrade.php Verify there are no problems during upgrade. In browser 1, Verify there's a new 'Dropbox' oauth2 service in Site admin -> Server -> OAuth2 services In browser 2, go to Private files and open Dropbox repository again If you are on the private files page, just refresh. Verify you are requested to log back in Repeat Upgrade test and CLI Upgrade test, performing the dropbox setup -Prerequisites #1 and #2
    • Affected Branches:
      MOODLE_310_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
    • Fixed Branches:
      MOODLE_400_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-70271-master
    • Story Points:
      1
    • Sprint:
      QA blitz 3, Navigation push ahead, Navigation push 2, Navigation push 3

      Description

      We got this email from DropBox today and wondering if anything needs to be changed in Moodle:

      Action Required: Token and Permission Updates

      The Dropbox API now supports OAuth scopes, PKCE, refresh tokens, and short-lived access tokens. We’re asking developers to review their app’s permission settings and ensure their apps support short-lived access tokens. Apps that require background access will need to update to use refresh tokens, which is made easier by using our updated SDKs.

      Starting September 30th, 2021, the Dropbox OAuth flow will no longer return long-lived access tokens. It will instead return short-lived access tokens, and optionally return refresh tokens. Please be sure to review, test, and move to the new permission model before then.

      For detailed instructions, please see:

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              peterdias Peter Dias
              Reporter:
              rex Rex Lorenzo
              Peer reviewer:
              Mihail Geshoski Mihail Geshoski
              Integrator:
              Ilya Tregubov Ilya Tregubov
              Tester:
              Gladys Basiana Gladys Basiana
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
              Votes:
              3 Vote for this issue
              Watchers:
              13 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                13/Dec/21

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 days, 6 hours, 16 minutes
                  2d 6h 16m