logo
search
Others

How to Refresh an Expired Office Add-in Access Token

Aamir Naveed AkramAamir Naveed Akram Oct 1, 2026 868 views

Question details

The user needs to refresh an expired authentication token for an Office add-in to restore its functionality.

How to Refresh an Expired Office Add-in Access Token
Product
Microsoft Office
Device & OS
not provided
Scenario
Developing or running an Office add-in that relies on the OfficeRuntime.auth.getAccessToken API for user authentication.
Observed behavior
The Office add-in stops working after approximately 87 minutes because the access token expires.
Before you start

Verify that your add-in code correctly handles the OfficeRuntime.auth.getAccessToken method and check your Azure App registration settings before debugging token lifespans.

Solution 1Recommended

Consult Microsoft Q&A Office Development Specialists

Since token refresh behavior involves deep Microsoft Office JavaScript API integration and Azure AD configurations, the best route is consulting Microsoft development specialists.

The OfficeRuntime.auth.getAccessToken API usually returns a token valid for about 87 minutes. Implementing a robust refresh token flow typically requires handling the expiration on your backend or prompting the user to re-authenticate seamlessly.

1
Navigate to Microsoft Q&A

Open your web browser and go to the official Microsoft Q&A website.

2
Select Office Development

Filter the platform tags or search directly for the 'Office Development' section, which handles JavaScript API issues.

3
Post your query

Create a new thread detailing your add-in's authentication flow, the 87-minute expiration issue, and provide any relevant code snippets using OfficeRuntime.auth.getAccessToken.

Consult Microsoft Q&A Office Development Specialists
Developer Resource: Microsoft engineers and community specialists frequently monitor the Office Development section and can provide code-level debugging assistance tailored to your add-in architecture.
Free Microsoft Office alternative

Try WPS Office for a Seamless Document Workflow

If you are tired of complex Microsoft Office configurations and add-in deployment issues, consider switching to WPS Office. It provides a free, lightweight, and highly compatible alternative that simplifies your daily tasks without the overhead.

  1. 1. Download WPS Office: Visit the official WPS Office website and click the free download button for your operating system.
  2. 2. Install the Software: Run the downloaded installer and follow the simple on-screen instructions to complete the setup.
  3. 3. Open Your Documents: Launch WPS Office and instantly open your existing Word, Excel, or PowerPoint files with perfect formatting compatibility.
Highly compatible with standard Microsoft Office formats, including .docx, .xlsx, and .pptx.Free and lightweight, consuming significantly fewer system resources.Familiar user interface ensuring a seamless migration with zero learning curve.Avoids the complexity of deep JavaScript add-in token troubleshooting for everyday office tasks.
microsoft office alternative - wps office

Frequently Asked Questions

Why does the OfficeRuntime.auth.getAccessToken token expire after 87 minutes?

By default, access tokens issued by Azure Active Directory for Office add-ins have a lifespan of approximately 60 to 90 minutes (often exactly 87 minutes) for security reasons. Once the token expires, a new one must be acquired to maintain access to secured resources.

Can I automatically refresh the token within my Office add-in?

Yes, typically your web application backend handles token refreshing using a refresh token, or your client-side JavaScript can catch the 13006 error (token expiration) and silently call the getAccessToken method again to prompt the issuance of a new token.

Where can I find sample code for handling Office add-in token expiration?

Microsoft provides extensive documentation and sample repositories on GitHub, particularly under the OfficeDev accounts, detailing Single Sign-On (SSO) and token management best practices.

Does WPS Office support Microsoft Office add-ins?

WPS Office supports many standard COM and VSTO add-ins, but web-based Office JavaScript API add-ins (like those using OfficeRuntime.auth) have different architectures and may require adjustments or different compatibility layers.