AzureAD / azure-activedirectory-library-for-js

The code for ADAL.js and ADAL Angular has been moved to the MSAL.js repo. Please open any issues or PRs at the link below.
https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/maintenance/adal-angular
Apache License 2.0
627 stars 374 forks source link

[Question] Custom token cache #828

Closed carlosscastro closed 5 years ago

carlosscastro commented 5 years ago

ADAL dotnet allows to specify a custom token cache implementation. Does ADAL js provide such a thing? I couldn't find any docs on it.

Thanks!

navyasric commented 5 years ago

ADAL.js does not allow a custom token cache implementation. ADAL.js caches tokens in the browser storage( i.e. localStorage or sessionStorage). The default is sessionStorage. The library allows you to configure the storage at initialization time as follows:

window.config = {
    clientId: '[Enter your client_id here, e.g. g075edef-0efa-453b-997b-de1337c29185]',
    cacheLocation: "localStorage"
};

var authContext = new AuthenticationContext(config);