I am writing a UWP application with ADAL authentication. The UWP app won't have much user interaction. Therefore I like to use ClientCredtial() and then the app will work without user login.
If I use ClientCredential() in authContext.AcquireTokenAsync(), I've got a very weird error message "System.ArgumentNullException: 'Value cannot be null.'".
It works perfect in a console program (https://github.com/Azure-Samples/active-directory-dotnet-daemon) but it works only once but it will fail after the first success in the UWP app. I mean it doesn't work from the 2nd attempt. clientCredential = new ClientCredential(clientId, appKey); result = await authContext.AcquireTokenAsync(ResourceId, clientCredential);
However the method (authContext.AcquireTokenAsync) works fine with other parameters such as client id, etc as below. result = await authContext.AcquireTokenSilentAsync(ResourceId, clientId);
Does UWP have got restriction on authContext.AcquireTokenSilentAsync() with ClientCredential(clientid, key)?