Hubbo Document Viewer · 1.8.7

OneDrive Import
Complete Guide

From Azure registration to your first imported file – built on a real-world setup, including every error that appeared along the way and how it was solved.

Author Tony Lif  ·  Website hubbo.se  ·  Updated June 2026
Contents
01How the OneDrive import works 02What you need 03Register an app in Azure 04Configure the manifest 05Enter the Client ID in WordPress 06Test the import 07Day-to-day use 08Troubleshooting 09Technical background
01 — Overview

How the OneDrive import works

From version 1.8.3 the plugin uses its own file browser, fetching your files via Microsoft Graph – Microsoft's data API. Microsoft's old built-in file picker (OneDrive.js v7.2) is not used; it has been retired and no longer works reliably for personal accounts.

  1. You click Import from OneDrive.
  2. The whole page is sent to Microsoft's sign-in (no popup) and back again.
  3. The plugin shows a file list where you browse folders and pick a file.
  4. The server fetches the file via Microsoft Graph using your sign-in token and places it in the media library.
Security No passwords are stored in the plugin. Sign-in happens in Microsoft's own window, and the token received is temporary – valid for about one hour. The plugin requests read-only permission (Files.Read.All).
02 — Requirements

What you need

Important No Azure subscription, no credit card and no Office 365 licence is required. The app registration is free, and you don't need to belong to any organisation – your ordinary personal Microsoft account is enough.
03 — Step 1

Register an app in Azure

1.1 — Sign in

  1. Go to portal.azure.com and sign in with the Microsoft account whose OneDrive you want to fetch files from.
  2. Ignore any prompts to start a subscription – it is not needed.

1.2 — Create the registration

  1. Search for App registrations in the search bar at the top.
  2. Click + New registration.
  3. Name: anything you like, e.g. Hubbo Document Viewer.
  4. Supported account types: choose the option that includes both organisational accounts and personal Microsoft accounts.
  5. Redirect URI: leave empty – it is set in the manifest in step 2.
  6. Click Register.

1.3 — Copy the Client ID

On the app's Overview page, copy the value next to Application (client) ID – a long string like 28fdfec3-ce39-489b-b13b-0301ef5623ff. You will need it in step 3.

Known portal glitch The Azure page Authentication (Preview) may refuse to load for personal accounts ("An error occurred while loading…" / "timed_out"). That is Microsoft's fault, not yours. Skip that page entirely and make all settings via the Manifest instead – that page always works.
04 — Step 2

Configure the manifest

In the app's left-hand menu, under Manage, click Manifest (the row with the {} icon). Three things need to be set in the text file.

2.1 — Redirect URI

Find the line "replyUrlsWithType": [] and replace it with (swap hubbo.se for your own domain):

"replyUrlsWithType": [
    {
        "url": "https://hubbo.se/wp-content/plugins/hubbo-document-viewer/onedrive-redirect.html",
        "type": "Web"
    }
],
Three traps The URL must not contain a query string (?page=…) – Azure will refuse to save. The type must be "Web", not "Spa" (SPA causes the unsupported_response_type error). And keep the comma after the closing bracket.

2.2 — Implicit flow

Find these two lines and change both from false to true:

"oauth2AllowIdTokenImplicitFlow": true,
"oauth2AllowImplicitFlow": true,

2.3 — Account type

Find the "signInAudience" line near the end of the file and make sure it reads:

"signInAudience": "AzureADandPersonalMicrosoftAccount",
Common error If it says "PersonalMicrosoftAccount" you will get the error "The request is not valid for the application's 'userAudience' configuration" at sign-in. The plugin uses Microsoft's common sign-in endpoint (/common/), which requires the value above.

2.4 — Save

Click Save at the top. A green tick means the Azure part is done. Wait 3–5 minutes before testing – changes do not take effect immediately.

05 — Step 3

Enter the Client ID in WordPress

  1. Go to Document Viewer → Settings.
  2. Scroll to Cloud import (Google Drive & OneDrive).
  3. Paste your Application (client) ID into the Microsoft Client ID field.
  4. Click Save settings.
06 — Step 4

Test the import

  1. Go to Document Viewer → ☁️ Import.
  2. Click Import from OneDrive. The whole page is sent to Microsoft's sign-in – this is normal, no popup is used.
  3. Sign in and consent to the app reading your files (the question only appears the first time).
  4. You are automatically sent back, and the file list opens.
  5. Browse to a file, click Select, confirm year and month – done!
Working? Then the one-time setup is complete. The sign-in remembers you for about an hour, so you can fetch several files in a row without signing in again.
07 — Everyday

Day-to-day use

08 — Troubleshooting

All known errors and solutions

The table covers every error that appeared during the real-world setup this guide is based on.

SymptomCauseSolution
"invalid_request: redirect_uri is not valid" The redirect URI in Azure does not match the one the plugin sends. Check that the manifest contains exactly …/hubbo-document-viewer/onedrive-redirect.html (step 2.1).
"The URL must not contain a query string" when saving The redirect URI contains ?page=…. Remove everything from the question mark onwards.
"unsupported_response_type" after sign-in The URI is registered as Spa, or the implicit flow is disabled. Type "Web" + both implicit lines true (steps 2.1–2.2).
"…not valid for the application's 'userAudience' configuration" signInAudience is set to personal accounts only. Change it to "AzureADandPersonalMicrosoftAccount" (step 2.3).
Sign-in succeeds but no file list appears Older version (1.8.2–1.8.4) using a popup window; browsers block the communication. Update to 1.8.5+ which uses a full-page flow.
"The download URL … was blocked" Older version (≤1.8.6) downloaded via a direct link whose domain was not allowlisted. Update to 1.8.7 – the server fetches via Microsoft Graph instead.
"The sign-in … has expired" / HTTP 401 The token is older than about one hour. Click the OneDrive button again to renew the sign-in.
Authentication (Preview) won't load in Azure Known portal bug for personal accounts. Use the Manifest page instead. Incognito or entra.microsoft.com may also help.
Microsoft's sign-in page keeps "spinning" Temporary slowness at Microsoft, sometimes worsened by tracking protection. Close and try again. CORS errors about events.data.microsoft.com are harmless (telemetry).
"OneDrive is not configured" The Microsoft Client ID is missing from the settings. Enter the Application (client) ID under Settings → Cloud import (step 5).
09 — Under the hood

Technical background

Why does the setup look the way it does? The decisions in brief.