MSAL UserAgentApplication: local storage not working

UserAgentApplication.localCache = "localStorage" does not work.

Steps to play:

var client = new Msal.UserAgentApplication(config.aadClientId, config.aadAuthority...);

client.cacheLocation = "localStorage"; 

client.loginPopup().then( ... );

Result: MSAL toners are stored in the session store. (Chrome Developer Tools)

Expected: Tokens should be in local storage.

I am using msav 0.1.1 javascript library through https://secure.aadcdn.microsoftonline-p.com/lib/0.1.1/js/msal.min.js

+1
source share
1 answer

, Msal.Storage UserAgentApplication . , UserAgenApplication Msal.Storage , . client.cacheLocation = "localStorage" , Msal.Storage .

 ...
 new Msal.Storage("localStorage");

 var client = new Msal.UserAgentApplication(config.aadClientId, config.aadAuthority, ...);
 ...
+1

Source: https://habr.com/ru/post/1687654/


All Articles