AzureAD/azure-activedirectory-library-for-dotnet

Having issues with the AcquireTokenSilentlyAsync API.

mikaelm12 opened this issue · 1 comments

I read the documentation regarding the methods around acquiring tokens and apparently the AcquireTokenAsync doesn't check the token cache? I'm trying to implemented calling the AcquireTokenSilentlyAsync method and falling back to AcquireTokenAsync but it always fails even when I debug and can see that the tokenCache has items in it. We're passing in the IClientAssertionCertificate but don't have a user identifier so we're just passing in UserIdentifier.Any.

Any help would be appreciated. Thanks!

@mikaelm12 - can you use MSAL.NET instead? This library (ADAL) is deprecated and there aren't many people who can answer quesions on it.

But in particular for this flow, you do not need to call AcquireTokenSilent. This flow has no users, as you have noticed, and ADAL utilizes an in-memory app token cache by default.

For more details see: https://github.com/AzureAD/azure-activedirectory-library-for-dotnet/wiki/Client-credential-flows#clientassertion-in-adalnet