AzureAD / microsoft-authentication-library-for-dotnet

Microsoft Authentication Library (MSAL) for .NET
https://aka.ms/msal-net
MIT License
1.37k stars 337 forks source link

[Feature Request] Enable WAM on Windows Server 2016 #4147

Open gladjohn opened 1 year ago

gladjohn commented 1 year ago
gladjohn commented 1 year ago

On a Windows Server 2016 machine, we see the follow error when invoking the new broker

Exception: Microsoft.Identity.Client.NativeInterop.MsalRuntimeException: Status: Unexpected
Context: Caught exception
Tag: 0x2039c1cd

And subsequent calls to the ATI, briefly displays the WAM UI or AAD picker and then auto dismisses, and we log this

Exception: MSAL.NetCore.4.51.0.0.MsalClientException: 
    ErrorCode: authentication_canceled
Microsoft.Identity.Client.MsalClientException: User canceled authentication. 

On a different Win2016 Server, I see the following

image

Server info :

image

@MSamWils is there any data you want me to collect to troubleshoot this?

MSamWils commented 1 year ago

@gladjohn , thanks for testing it. Can you please enable MSALRuntime log for this issue? Exception: Microsoft.Identity.Client.NativeInterop.MsalRuntimeException: Status: Unexpected Context: Caught exception Tag: 0x2039c1cd

And also please collect fiddler trace for the prompt issue. Thanks.

gladjohn commented 1 year ago

@MSamWils shared all the info on chat. please let me know if you need more details

gladjohn commented 1 year ago

Adding notes so we know what works and what doesn't with WAM on Server 2016.

Authority MSA-PT ATS ATI
lmo/org False - Error : Parameter prompt is duplicated
lmo/org True - WAM UI shows up, upon selecting an account, Error : Missing wamcompat_id_token in WAM case
lmo/common False - WAM UI shows up, upon selecting an account, Error : Missing wamcompat_id_token in WAM case
lmo/consumers False Works Successfully gets a token
lmo/tenant_id False - Error : Parameter prompt is duplicated

Note :- ATS was not tested when ATI did not work.

Other MSALRuntime specific features that work as expected:

Other features that do not work :

ROPC also throws the Missing wamcompat_id_token in WAM case error

Just to add one more note, when we get the Error : Parameter prompt is duplicated error, passing in a login_hint suppresses the error.

gladjohn commented 1 year ago

Some more notes based on investigation :