WIF: Memory leak issue with WIF 3.5 – Microsoft.IdentityModel.Tokens – SecurityTokenCacheKey

Issue:Recently we came across a case where memory leak issue is identified within WIF 3.5 DLL inside the “Microsoft.IdentityModel.Tokens” class. How does this happen: The source code has a coding BUG where “SecurityTokenCacheKey” are not getting cleared off properly. Impacted heap structures seen in memory dumps: 00007ff97bbb0038   371165     17815920 System.Collections.Generic.LinkedListNode`1[[System.Object, mscorlib]] 00007ff97bba6f48   371230     17819040 Microsoft.IdentityModel.Tokens.SecurityTokenCacheKey…

0

ADAL: Secure Web API with ADFS 3.0 for Desktop Client

I came across one of the requirements, where my customer requested me to create a sample ASP.NET WEB API application, and later be consumed by a rich desktop client like WPF. It had one OAuth 2.0 protocol authorization rider before accessing the WEB API resource. And, the OAuth 2.0 access token must be retrieved from…