Overview
WayHost stores backups in OneDrive via Microsoft identity (Entra ID) OAuth. You register a Web app, add the redirect URI below, paste Application (client) ID and client secret into the backup destination, then click Connect.
Redirect URL (required)
In the Entra app registration, under Authentication → Platform configurations → Web → Redirect URIs, add exactly:
https://host.hamdek.com/api/integrations/onedrive/callback
A wrong scheme or domain causes Microsoft redirect / AADSTS errors.
Create the Microsoft Entra app
- Open Azure Portal → Microsoft Entra ID → App registrations → New registration.
- Name the app (for example “WayHost Backups”).
- Supported account types: choose what fits your org (often “Accounts in any organizational directory and personal Microsoft accounts” if you use consumer OneDrive).
- Redirect URI: platform Web, URI =
https://host.hamdek.com/api/integrations/onedrive/callback.
- Register.
- Certificates & secrets → New client secret → copy the secret Value immediately (it is shown once).
- Overview → copy Application (client) ID.
- API permissions → Microsoft Graph → Delegated:
Files.ReadWrite
offline_access
Grant admin consent if your tenant requires it.
Add the destination in WayHost
- Project → Settings → Backup destinations → Add destination.
- Type: OneDrive.
- Paste Application (client) ID and client secret Value.
- Test (optional) → Save.
- Click Connect in the table and finish the Microsoft login.
WayHost uses a folder such as wayhost-<project-slug>-backups in the OneDrive root for that project.
MICROSOFT_CLIENT_ID=...
MICROSOFT_CLIENT_SECRET=...
Per-destination credentials in the UI override these env values when set.
Troubleshooting
- Redirect URI mismatch — confirm the Web redirect URI is exactly
https://host.hamdek.com/api/integrations/onedrive/callback.
- Need admin approval — a tenant admin must grant consent for Graph permissions.
- Secret expired — create a new client secret in Entra and update the destination, then Connect again.