OfficeDev / office-js-helpers

[ARCHIVED] A collection of helpers to simplify development of Office Add-ins & Microsoft Teams Tabs
MIT License
126 stars 57 forks source link

feature request: Store token in OfficeRuntime.Storage #145

Closed Ballzer0 closed 5 years ago

Ballzer0 commented 5 years ago

LocalSettings.storage is unavailable if you are writing a customFunction. My suggestion would be to switch to OfficeRuntime.Storage instead to avoid any issues with customFunctions in excel.

https://docs.microsoft.com/en-us/office/dev/add-ins/excel/custom-functions-authentication?view=excel-js-1.9

Ballzer0 commented 5 years ago

I didnt realize you could pass in a different TokenStorage type. i will close this issue.

Solved by using inMemoryStorage:

const authenticator = New Authenticator(undefined, new TokenStorage(2));