I was having the same issue but only running the code directly from Azure (inside an Azure Website). I solved upgrading 'Microsoft.IdentityModel.Clients.ActiveDirectory' package to '2.6.1-alpha'. Linksys Support
Should you have any suggestions, please let me know.
... View more