Closed rluta closed 6 years ago
Unfortunately the entire token logic is based off of localStorage
. At best we can switch out to sessionStorage
but that's about it. That said, localStoage
I think its very integral to Office.js as well. Is there a reason why it is disabled?
@rluta ping..
localStorage
is disabled by Chrome whenever someone disables third-party cookies in the preferences which is a fairly common non-default setting.
We're running into this same issue, along with some related behavior we don't like with the default configuration on other browsers, in addition to specific Chrome issue @rluta raised. Wondering if there is a workaround or we're missing something (i.e. for deployed add-ins, does Microsoft proxy the implementation so it's served from a Microsoft domain, etc.)?
I am looking into an approach where you can use in-memory cache to store the values instead of relying on localStorage. Will keep this thread updated.
@TimJohns, @rluta. Finally added an inmemory storage option. To use it you'll need to do the following:
const authenticator = new OfficeHelpers.Authenticator();
const authenticator.endpoints = new OfficeHelpers.Endpoints(StorageType.InMemoryStorage);
const authenticator.tokens = new OfficeHelpers.Tokens(StorageType.InMemoryStorage);
That should throw 2 warnings in your console signifying that we are using in-memory storage. Let me know if you have issues.
I'm trying to use the Office Helpers to authenticate against a private OAuth2 endpoint with implicit flow in a React based Add-In for Excel.
When I run the following code in the add-in within the
Office.initialize
callback and my add-in is side loaded in Excel 365 :I always get the following error from chrome in the debug console:
Is there a way to prevent the EndpointManager from using the localStorage ?
I tried both version 0.7.4 and 0.8.0-beta.4 without success.