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

acquireToken doesn't cache the new token #774

Closed YAJeff closed 6 years ago

YAJeff commented 6 years ago

I've got an adal client that is supposed to connect to two different AD applications from one login. So I initially authenticate the user for both resources, separating their URLs with a ';' semicolon. Then when I need an access token for a specific resource, I call acquireToken and pass in the URL for the specific resource I need. I'm using the raw adal.js library, without angular.

Every call to acquireToken seems to take a few seconds. Monitoring the network calls, I can see that it is attempting to renew the token every time, even though the acquireToken is attempting to retrieve a cached token for that resource, In the adal code, I don't see where the retrieved token is being cached for that resource.

Is there something I'm missing? Would like to improve the slow performance of using this library.

YAJeff commented 6 years ago

I'm also using a custom redirect page, so my main application doesn't reload every time. This redirect page is essentially a blank html page. Does the adal library need to be referenced in there?

YAJeff commented 6 years ago

Yep. That was it. It appears I've answered my own question.