0

How to use the OfficeRuntime API on PROD environment.

I'm working on a excel add-in using custom function where the function use a OfficeRuntime.auth.getAccessToken() to fetch the token. The excel add-in is deploy in k8s cluster and the manifest is publish on SharePoint.

Env: Excel add-in running on K8s cluster and manifest in SharePoint.

Error I'm getting: TypeError: Cannot read properties of undefined (reading 'getAccessToken')

Question What is the process to PROD that allow the use of OfficeRuntime API?

Expect to have the OfficeRuntime.auth.getAccessToken() be available in PROD env.

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45

1 Answers1

0

The getAccessToken method calls the Azure Active Directory V 2.0 endpoint to get an access token to your add-in's web application. So, enables add-ins to identify users. This API requires a single sign-on configuration that bridges the add-in to an Azure application. Office users sign-in with Organizational Accounts and Microsoft Accounts. Microsoft Azure returns tokens intended for both user account types to access resources in the Microsoft Graph.

Make sure that your add-in is run in any Office application.

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45