Setting up OAuth 2.0 for Dropbox by using stored access tokens | HCL Digital Experience

Set up an OAuth 2.0 access for Dropbox by using stored access tokens. Follow these steps to set up an OAuth 2.0 connection of a Dropbox resource through the Ajax Proxy.


  1. Create an app at your Oauth2.0 provider Dropbox.
    1. Open a browser and go to
    2. Select My Apps and click Create app.
    3. Choose the API dropbox API . Choose the type of access that you need. Give a unique name for your app. Then, click Create App. Dropbox displays the App Settings panel for the app that you created.
    4. In the App Settings page, click Generated Access Token.
    5. Note the value of the access token that you created.
    6. Sign out of your Dropbox session.
  2. Provide valid SSL keys of the dropbox API host.
    1. Log in to the WebSphere® Application Server admin console of the Proxy.
    2. Select Security > SSL certificate and key management > Key stores and certificates.
    3. Click the truststore that is used by the Portal Server, Depending on your security configuration and topology, this NodeDefaultTrustStore, or CellDefaultTrustStore.
    4. Select the Signer Certificates from the Additional Properties section.
    5. Click Retrieve from port.
    6. Enter as Host value, 443 for the Port address, and enter an alias name like my_dropbox. Then, click Retrieve signer information.
    7. The signer certificate is loaded to your WebSphere® Application Server administration. Click OK to add the certificate to your WebSphere® Application Server configuration, then click Save to add the settings at the master configuration.
  3. Create a Credential Slot entry for the access token.
    1. Log in to the Portal by using an Admin user.
    2. Click Open portal administration and select Credential Vault in the Access section.
    3. Click Add a Vault Slot. Enter MyAccessTokenCvSlot for the slot name. Select the vault resource that you want to use, or create a new vault resource. Check the Vault is shared setting. Use the Shared user ID Bearer and set the access token that you noted in step 1e.
    4. Click OK to create the new vault slot.
  4. Create an Outbound HTTP connection policy for the new resource.
    1. Create the following XML document by using a capable XML editor or text editor.
      <?xml version="1.0" encoding="UTF-8"?>
      <proxy-rules xmlns:xsi="" 
              <dynamic-policy name="dropbox-idp.urls">
          <mapping contextpath="/myproxy" url="*">
      	<policy name="dropbox-idp.policy" url="{$dropbox-idp.urls}" >
    2. Save the document to a file. For example, save the file to /tmp/global_oauth_update.xml.
    3. Apply the configuration at the Outbound HTTP Connections global configuration. Run the following task to export the outbound HTTP connection configuration to an XML document.
      AIX: ./ update-outbound-http-connection-config -DconfigFileName=/tmp/global_oauth_update.xml \
              -DWasPassword=password -DPortalAdminPwd=password 
      HP-UX: ./ update-outbound-http-connection-config -DconfigFileName=/tmp/global_oauth_update.xml \
                -DWasPassword=password -DPortalAdminPwd=password 
      IBM i: update-outbound-http-connection-config -DconfigFileName=/tmp/global_oauth_update.xml \
              -DWasPassword=password -DPortalAdminPwd=password 
      Linux: ./ update-outbound-http-connection-config -DconfigFileName=/tmp/global_oauth_update.xml \
                -DWasPassword=password -DPortalAdminPwd=password 
      Solaris: ./ update-outbound-http-connection-config -DconfigFileName=/tmp/global_oauth_pdate.xml \
                  -DWasPassword=password -DPortalAdminPwd=password 
      Windows: ConfigEngine.bat update-outbound-http-connection-config -DconfigFileName=/tmp/global_oauth_update.xml \
                -DWasPassword=password -DPortalAdminPwd=password
      The protected resource is now ready-to-use.
  5. Test the connection. To test the connection to the Dropbox resource through oauth2, you can upload a test file (for example, a jpg image or a plain text file ) to your Dropbox account. Then, use CURL to download the file through the Ajax proxy.
    1. Upload a test resource to your Dropbox folder: open a browser and go to Sign in using your Dropbox credentials.
    2. Click the Apps folder, then click the folder of the app that you created in Step 1c. Click Upload Files. In the file chooser, select a test file that you want to upload.
    3. Start the following two curl commands to test the connection:
      curl -c pc.jar " \
      curl -b pc.jar \ "" \
      --header "Dropbox-API-Arg: {\"path\": \"/test.jpg\"}" >result_drop.jpg
      • The variable is for the host name and port number of the Portal Server.
      • The variable portal_user and portal_pwd are for the portal credentials that you want to use.
      • The variable /test.jpg is for the test resource that you uploaded in step 5b.