How to Configure a Service Account for OneDrive for Business Backup
Question details
The user needs to configure a service account for a backup utility to continuously access OneDrive for Business without authentication tokens expiring.

- Product
- OneDrive for Business
- Device & OS
- not provided
- Scenario
- Setting up automated backups that write data to a OneDrive for Business account.
- Observed behavior
- The backup utility currently uses a personal account for authentication, resulting in the OAuth token expiring every 90 days and interrupting the automated backup process.
Ensure you have Microsoft 365 Global Administrator or Privileged Role Administrator access, as configuring application permissions and consenting to unattended service access requires elevated privileges.
Register an Application in Microsoft Entra ID (Azure AD) for Unattended Access
Set up an Azure AD application using the Client Credentials flow to grant your backup utility continuous access without relying on user-interactive tokens.
To avoid the 90-day token expiration associated with delegated permissions (personal user accounts), enterprise tools must use the Client Credentials grant flow. This involves registering an application in Microsoft Entra ID and granting it Application Permissions, allowing it to act as its own service entity.
Log in to the Microsoft Entra admin center with your administrator credentials and navigate to 'Identity' > 'Applications' > 'App registrations'.
Click 'New registration', provide a descriptive name for your backup utility, select the supported account types for your organization, and click 'Register'.
Go to 'API permissions' on the left menu, click 'Add a permission', select 'Microsoft Graph', and choose 'Application permissions'. Search for and select appropriate file permissions (e.g., Files.ReadWrite.All).
After adding the permissions, click the 'Grant admin consent for [Your Organization]' button to authorize the application to run without individual user login.
Navigate to 'Certificates & secrets', click 'New client secret', set an expiration period, and copy the generated secret value to input into your backup utility's configuration.

Consult Microsoft Q&A and Documentation for OAuth Implementation
Review official Microsoft guidelines or seek community expert advice if your specific backup utility requires customized OAuth flows.
Manage Your Cloud Documents Seamlessly with WPS Office
While establishing backend service accounts for automated cloud backups, you need a highly efficient environment for your day-to-day document tasks. WPS Office provides a lightweight, robust, and completely free alternative to Microsoft Office that easily handles your local and cloud documents.
- 1. Download the software: Visit the official WPS website and download the free WPS Office installation package for your operating system.
- 2. Install and launch: Run the installer, follow the on-screen prompts to complete the setup, and launch the application.
- 3. Connect your cloud: Open the WPS Office dashboard, navigate to the Cloud storage section, and easily link your preferred cloud drives for direct document access.

Frequently Asked Questions
Why does my OneDrive authentication token expire every 90 days?
By default, delegated user authentication tokens (OAuth) associated with personal or interactive user accounts are governed by Azure AD token lifetime policies. They typically expire around 90 days for security purposes, requiring interactive re-authentication.
Do I need a separate Microsoft 365 license for a service account?
If you use a dedicated interactive user account as a service account, it requires a standard Microsoft 365 license that includes OneDrive for Business. However, if you use an App Registration with Application Permissions (Client Credentials flow), a dedicated user license is generally not required.
Can standard Microsoft accounts be used for unattended backups?
Using standard Microsoft accounts for unattended, automated enterprise backups is not recommended. They rely on delegated permissions that enforce interactive logins, which leads to the token expiration issues. Automated tools should use Application Permissions.




