Main Menu
Sub Menu

WPDM OneDrive Integration

Complete setup instructions for connecting Microsoft OneDrive to WordPress Download Manager.


Prerequisites

Before you begin, ensure you have:

  • WordPress 5.0 or higher
  • WordPress Download Manager plugin (Free or Pro)
  • A Microsoft account (personal or Microsoft 365/Business)
  • Administrator access to your WordPress site

Step 1: Create an Azure AD Application

To connect OneDrive, you need to register an application in Microsoft Azure.

1.1 Access Azure Portal

  1. Go to Azure Portal
  2. Sign in with your Microsoft account
  3. If you don't have an Azure account, you can create one for free

1.2 Register a New Application

  1. In the Azure Portal, search for "App registrations" in the top search bar
  2. Click "App registrations" from the results
  3. Click "+ New registration" button

1.3 Configure Application Details

Fill in the registration form:

Field Value
Name WPDM OneDrive (or any name you prefer)
Supported account types Select "Accounts in any organizational directory and personal Microsoft accounts"
Redirect URI Select "Web" from dropdown

Important: Leave the Redirect URI field empty for now. We'll add it in the next step.

  1. Click "Register"

1.4 Note Your Application (Client) ID

After registration, you'll see the app overview page.

  1. Copy the "Application (client) ID" - you'll need this later
  2. Keep this page open

Step 2: Configure Redirect URI

2.1 Get Redirect URI from WordPress

  1. In WordPress admin, go to Downloads → Settings
  2. Click the "OneDrive Connect" tab
  3. Find the "Redirect URI" field
  4. Copy the URL (it should look like: https://yoursite.com/onedrive-redirect)

2.2 Add Redirect URI in Azure

  1. Back in Azure Portal, in your app registration
  2. Click "Authentication" in the left sidebar
  3. Under "Platform configurations", click "+ Add a platform"
  4. Select "Web"
  5. Paste your Redirect URI in the "Redirect URIs" field
  6. Leave other options as default
  7. Click "Configure"

Step 3: Create Client Secret

3.1 Generate Secret

  1. In your Azure app registration, click "Certificates & secrets" in the left sidebar
  2. Under "Client secrets", click "+ New client secret"
  3. Enter a description (e.g., WPDM OneDrive Secret)
  4. Choose an expiration period:
    • Recommended: 24 months
    • You'll need to generate a new secret before expiration
  5. Click "Add"

3.2 Copy Secret Value

Critical: Copy the secret Value immediately! It will only be shown once.

Column What to Copy
Value ✅ Copy this (the actual secret)
Secret ID ❌ Not needed

Store this value securely - you'll enter it in WordPress.


Step 4: Configure API Permissions

4.1 Add Required Permissions

  1. Click "API permissions" in the left sidebar
  2. Click "+ Add a permission"
  3. Select "Microsoft Graph"
  4. Select "Delegated permissions"
  5. Search and add these permissions:
Permission Description
Files.Read Read user files
Files.Read.All Read all files user can access
User.Read Read user profile
offline_access Maintain access (for refresh tokens)
  1. Click "Add permissions"

4.2 Verify Permissions

Your API permissions should now show:

Microsoft Graph (4)
├── Files.Read          Delegated
├── Files.Read.All      Delegated
├── User.Read           Delegated
└── offline_access      Delegated

Note: Admin consent is NOT required for these delegated permissions.


Step 5: Configure WordPress Plugin

5.1 Enter Credentials

  1. In WordPress admin, go to Downloads → Settings
  2. Click the "OneDrive Connect" tab
  3. Enter your credentials:
Field Value
Application (Client) ID Paste the Application ID from Step 1.4
Client Secret Paste the Secret Value from Step 3.2
  1. Click "Save Changes"

5.2 Connect Your Account

After saving:

  1. Click the "Connect with OneDrive" button
  2. A popup window will open
  3. Sign in with your Microsoft account
  4. Review the permissions and click "Accept"
  5. The popup will close automatically
  6. You should see "Connected successfully!" message
  7. Refresh the page to see your account details

Step 6: Start Using OneDrive Files

6.1 Attach Files to Downloads

  1. Create or edit a Download (Downloads → Add New or Downloads → All Downloads)
  2. In the "Attach File" section, click "Select From OneDrive"
  3. Browse your OneDrive folders
  4. Click "Attach" next to any file
  5. The file will be added to your download package

6.2 Navigation Tips

  • Click folders to navigate into them
  • Use the back button to go up one level
  • The breadcrumb shows your current location
  • File size and modification date are shown for each item

Troubleshooting

"Connection Failed" Error

Possible causes:

  • Incorrect Client ID or Secret
  • Redirect URI mismatch
  • Missing API permissions

Solutions:

  1. Verify Client ID is the "Application (client) ID" (not Directory ID)
  2. Ensure Redirect URI in Azure exactly matches the one shown in WordPress
  3. Check all required API permissions are added

"Access Denied" After Login

Possible causes:

  • Missing API permissions
  • Account doesn't have OneDrive access

Solutions:

  1. Verify all permissions from Step 4 are added
  2. Ensure you're signing in with an account that has OneDrive

Files Not Loading

Possible causes:

  • Token expired
  • Network issues

Solutions:

  1. Disconnect and reconnect your OneDrive account
  2. Check browser console for error messages
  3. Verify your site can make outbound HTTPS requests

"Token Expired" Message

The plugin automatically refreshes tokens. If you see this:

  1. Click "Disconnect OneDrive"
  2. Click "Connect with OneDrive" again
  3. Re-authorize the application

Security Best Practices

Protect Your Credentials

  • Never share your Client Secret publicly
  • Don't commit credentials to version control
  • Use environment variables for sensitive data in development

Manage Access

  • Regularly review connected applications in your Microsoft account
  • Revoke access for applications you no longer use
  • Set calendar reminders for secret expiration

Revoke Access

To completely disconnect:

  1. In WordPress: Click "Disconnect OneDrive" in settings
  2. In Microsoft: Go to account.microsoft.com/privacy
  3. Find "Apps and services" and revoke access to your app

Azure App Settings Summary

For reference, here are all the Azure AD app settings:

Application Name: WPDM OneDrive (or custom) 
Application Type: Web 
Account Types: Personal + Organizational 
Redirect URI: https://yoursite.com/onedrive-redirect 
API Permissions (Delegated): 
    - Microsoft Graph: Files.Read 
    - Microsoft Graph: Files.Read.All 
    - Microsoft Graph: User.Read 
    - Microsoft Graph: offline_access 
Client Secret: [Generated - expires in 24 months]

Getting Help

If you encounter issues:

  1. Check the WPDM Documentation
  2. Visit the Support Forum
  3. Ensure you're using the latest plugin version

Changelog

Version 2.0.0

  • Initial release
  • Microsoft OAuth 2.0 integration
  • OneDrive file browser
  • One-click file attachment
  • Personal and Business account support
  • Automatic token refresh
Last updated on Dec 6, 2025

Need More Clarification?

For any technical issue, if you are already using pro version please post in pro forum and free version users please post in free forum. Otherwise, if you have any pre-sale or order related query please contact live chat support team. For technical support.

Need Customization?

If you need additional customization on WordPress Download Manager or any type of custom support on WordPress you may contact our customization service.