Skip to content
This repository has been archived by the owner on Jun 30, 2023. It is now read-only.

tokenCache is always NULL for debug log in ADAL v3.19.8 or later - src/Microsoft.IdentityModel.Clients.ActiveDirectory/Internal/Flows/AcquireTokenHandlerBase.cs #1471

Closed
shigeyf opened this issue Dec 30, 2018 · 1 comment

Comments

@shigeyf
Copy link

shigeyf commented Dec 30, 2018

Which Version of ADAL are you using ? - v3.19.8 or later

Which platform has the issue? - all platform

What authentication flow has the issue? - no issues in authentication flow

Other? - please describe;
This is a debug log issue - please see the code below in the constructor of AcquireTokenHandlerBase.
There is no code to set TokenCache instance to a 'tokenCache' private property in the constructor before the line.
https://github.com/AzureAD/azure-activedirectory-library-for-dotnet/blob/dev/src/Microsoft.IdentityModel.Clients.ActiveDirectory/Internal/Flows/AcquireTokenHandlerBase.cs#L71

Expected behavior
Possible Solution
Should be okay with the following patch:

diff --git a/src/Microsoft.IdentityModel.Clients.ActiveDirectory/Internal/Flows/AcquireTokenHandlerBase.cs b/src/Microsoft.IdentityModel.Clients.ActiveDirectory/Internal/Flows/AcquireTokenHandlerBase.cs
index 14532502..b644564a 100644
--- a/src/Microsoft.IdentityModel.Clients.ActiveDirectory/Internal/Flows/AcquireTokenHandlerBase.cs
+++ b/src/Microsoft.IdentityModel.Clients.ActiveDirectory/Internal/Flows/AcquireTokenHandlerBase.cs
@@ -54,6 +54,7 @@ namespace Microsoft.IdentityModel.Clients.ActiveDirectory.Internal.Flows
protected AcquireTokenHandlerBase(RequestData requestData)
{
this.Authenticator = requestData.Authenticator;

  •        this.tokenCache = requestData.TokenCache;
           this.CallState = CreateCallState(this.Authenticator.CorrelationId);
           brokerHelper.CallState = this.CallState;
    

Additional context/ Logs / Screenshots - N/A

@jennyf19
Copy link
Contributor

jennyf19 commented Jan 3, 2019

@shigeyf This has been fixed and changes are in dev.

@jennyf19 jennyf19 modified the milestones: 4.4.3, 4.5.0 Jan 10, 2019
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

3 participants