Skip to content

Document Storage ​

Settings → Document Storage connects your organisation's existing document stores — Google Drive, OneDrive, or SharePoint — so staff can attach files that already live there without downloading them first.

Files are copied into Phanera. Nothing is ever written back to the connected store, and nothing Phanera holds depends on the connection staying alive: if a provider is later disconnected or deleted, every file already imported is unaffected.

Managing providers requires the Manage Storage Providers permission. Browsing a connected store and importing from it requires Browse Storage Providers — see Roles & Permissions.

How connections work ​

Each provider is one shared account. An administrator registers an OAuth application with Google or Microsoft, connects it once, and everyone with the browse permission reaches the store through that account. Staff do not sign in individually.

This has a consequence worth being deliberate about: anyone who can browse sees everything the connected account can see. Two ways to keep that tight —

  • Connect a dedicated account (for example an foi-documents@ service mailbox) that has been shared only the folders the FOI team should reach, rather than a personal account.
  • Set a root folder on the provider (below), which confines browsing to one folder and its children.

To expose a second account, or a second SharePoint site, add a second provider.

Provider types ​

TypeBrowsesRequires
SharePointThe default document library of one SharePoint siteEntra app registration + the site URL
OneDriveThe connected account's own OneDriveEntra app registration
Google DriveThe connected account's My Drive, including shared drivesGoogle Cloud OAuth client

Adding a provider ​

  1. Click Add provider and choose the type.
  2. Give it a display name — this is what staff see in the file picker, so name it after the place, e.g. "Council SharePoint".
  3. Fill in the credentials from your OAuth application (below).
  4. Save, then click Connect on the new row and complete the sign-in as the shared account.

The row shows Connected with the account it authorised as once the flow completes.

Fields ​

FieldNotes
Display nameShown to staff in the file picker
Tenant IDEntra (Azure AD) directory ID. Leave blank for multi-tenant apps. OneDrive and SharePoint only.
SharePoint site URLe.g. https://contoso.sharepoint.com/sites/foi. The site's default document library is used. Required for SharePoint.
Client ID / Client secretFrom your OAuth application. On edit, leave the secret blank to keep the existing one.
Root folder IDOptional. Confines browsing to one folder. Leave blank to browse the whole drive.
ScopesOptional override. Leave blank to use read-only defaults appropriate to the provider type.

WARNING

Changing the client ID, tenant, or site URL invalidates the existing connection. Reconnect the account afterwards.

Registering the OAuth application ​

Whichever provider you use, configure this redirect URI in the OAuth application — the exact value is shown in the add/edit dialog:

https://your-phanera-host/api/storage-providers/callback

Microsoft (OneDrive & SharePoint) ​

Register an application in the Entra admin centre with a Web redirect URI as above, create a client secret, and grant these delegated Microsoft Graph permissions:

  • Files.Read.All
  • Sites.Read.All (SharePoint only)
  • User.Read, openid, email, offline_access

Google Drive ​

Create an OAuth 2.0 Web application client in Google Cloud Console with the redirect URI above, and enable the Google Drive API. The default scopes request read-only access:

  • https://www.googleapis.com/auth/drive.readonly
  • openid, email

Read-only by design

The defaults request read access only. Phanera copies files out and never writes back, so write scopes would be asking for trust it does not need. If you override the Scopes field, keep it read-only.

Testing and disconnecting ​

  • Test performs a live round trip — it authenticates, resolves the document library, and lists the root. A failure records the reason against the provider, shown as See error on the row.
  • Disconnect clears the stored account, leaving the provider configured but unusable until reconnected.
  • Delete removes the provider entirely. Files already imported into Phanera are unaffected.

Creating, updating, connecting, disconnecting, and deleting providers are all recorded in the admin audit log.

Using it day to day ​

Once a provider is connected, the file controls on a request grow a menu. Instead of going straight to your computer's file picker, Add files offers:

  • This computer — the ordinary upload
  • Each connected store, by name

Choosing a store opens a browser: navigate folders, search, tick one or more files, then Add selected. Phanera fetches each file server-side and stores it exactly as if it had been uploaded from your machine — the same 25 MB limit, the same allowed file types, the same storage quota.

Imports report per file. If one document has been deleted upstream or is too large, the rest still land, and the failures are named.

TIP

Google Docs, Sheets and Slides have no file of their own to copy. They are exported on import — documents and presentations as PDF, spreadsheets as XLSX.

If no provider is connected, or you do not have the browse permission, the control stays a plain upload button.

Where it appears ​

PDFs added from a connected store go through the same handling as uploaded ones, including the redaction editor.

Message attachments take a slightly different route

A message and its attachments are sent together, so there is no message to import into until you click Send. Files picked from a store are therefore fetched into your browser and held with the message until it goes — which is also what lets an attached PDF open in the redaction editor before sending. Everywhere else, the file goes provider → Phanera without passing through your browser at all.

Security notes ​

  • The client secret and the account's refresh token are held in Azure Key Vault in production; the database columns are cleared once the values move to the vault.
  • The provider's access token never reaches the browser. Everything the file picker shows is proxied through Phanera, which checks your permission on every call.
  • The connection is read-only end to end: the server refuses anything other than browsing and reading, so there is no path by which Phanera could create, rename, or delete anything in your store.

Phanera — FOI, SAR, EIR & Complaints management