I'm developing a UWP app that needs to authenticate against an on-premise ADFS 2016 instance, but using Windows integrated authentication.
I'm using ADAL 3.19.8. The app is running on a Windows 10 device which is domain joined. The app has the Enterprise Authentication, Private Network (Client & Server), and Shared User Certificates capabilities enabled as mentioned here: https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/wiki/uwp-specificities
I'm setting the UseCorporateNetwork flag to true. Windows Integrated Authentication is enabled in Internet Options, and I've added the ADFS server to the Local Intranet zone.
Here's how I'm trying to authenticate:
string authority = "https://xxxx/adfs/oauth2";
const bool useCorporateNetwork = true;
var authContext = new AuthenticationContext(authority, false);
var authResult = await authContext.AcquireTokenAsync(
resourceURI,
clientID,
new Uri(clientReturnURI),
new PlatformParameters(PromptBehavior.Auto, useCorporateNetwork));
The authentication against ADFS is successful and I get the access and id tokens. However the app always presents the ADFS login screen. To proceed I enter the same username & password credentials I used to sign into Windows. Clearly this is not ideal and is not the behaviour users of the app would like to see.
Using Fiddler I see the UWP app calls https://xxxx/adfs/oauth2/authorize.
I can get the SSO behaviour I expect if I use the above code but within a WinForms app (although there is no useCorporateNetwork overload). Using Fiddler the WinForms app calls https://xxxx/adfs/oauth2/authorize/wia
What am I missing?