38 Dropbox and GDrive
Dimitri Witkowski edited this page 2021-05-08 15:47:16 +02:00

How to make Dropbox and Google Drive work on your server?

Dropbox

  1. Go to Dropbox Developers: https://www.dropbox.com/developers
  2. Create your app
  3. Choose Dropbox API, not business API, and the desired Dropbox access
  4. Setup URLs (the redirect uri is https://<your host>/oauth-result/dropbox.html)
  5. Add Dropbox app key to KeeWeb, either as dropboxAppKey config field, or in the UI
  6. Click Show secret and add it to KeeWeb in the same way, the config field is called dropboxSecret
  7. If it doesn't work, make sure that PKCE is enabled and custom scopes are configured on the Permissions tab
  8. To add a file from Dropbox folder using config.json, use the following snippet:
    {
        "settings": {
            "dropboxAppKey": "APP_KEY_FROM_DROPBOX",
            "dropboxSecret": "APP_SECRET_FROM_DROPBOX"
        },
        "files": [{
            "storage": "dropbox",
            "name": "Your file name",
            "path": "/your_file.kdbx"
        }]
    }
    

Google Drive

  1. Go to Google Developer Console: https://console.developers.google.com/

  2. Add a project

  3. Create OAuth Client ID

  4. Choose Web application

  5. Setup URLs (the redirect uri is https://<your host>/oauth-result/gdrive.html)

    URL here is the exact URL where you load KeeWeb: if it has index.html, add index.html there too.

  6. Set Client ID and Secret in KeeWeb, in gdriveClientId and gdriveClientSecret fields of your config

  7. You will need to either verify your domain, or add yourself to Risky Access Permissions By Unreviewed Apps Google Group (more about Google Drive in this issue).

  8. Enable Drive API for your project.

OneDrive

  1. Create an app in Azure Portal:
    Azure Portal

  2. Choose the desired audience and name, and click Register:
    App name

  3. Select Authentication and click Add Platform:
    Platform

  4. Choose "Single-page application"

  5. Enter a redirect URI as https://your-domain/oauth-result/onedrive.html:
    Domain

  6. Click Configure

  7. Add the following API permissions: Files.Read.All and Files.ReadWrite.All from Microsoft Graph section:
    Permissions

  8. Make sure the permission screen looks like this:
    API permissions

  9. Copy the Application (client) ID value from the Overview screen and put it in KeeWeb's config.json under onedriveClientId key

  10. If desired, your can also set up the secret in "Certificates and secrets" section and save it as onedriveClientSecret, but it doesn't seem to change anything