Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] MSAL Login does not work after upgrading to winappsdk 1.6 #4933

Open
cconner100 opened this issue Sep 18, 2024 · 1 comment
Open

[Bug] MSAL Login does not work after upgrading to winappsdk 1.6 #4933

cconner100 opened this issue Sep 18, 2024 · 1 comment
Assignees
Labels
needs attention Delete label after triage public-client

Comments

@cconner100
Copy link

Library version used

.NET version

.net 8.300. Windows App SDK 1.6

Scenario

PublicClient - desktop app

Is this a new or an existing app?

None

Issue description and reproduction steps

When our app was targeting WinAppSDK 1.5 the login would bring up the Browser login dialog box and allow us to login. After upgrading to WinAppSDK 1.6 we get the following error message and no Browser will pop up

AuthoritySignIn https://ziidmsapp.b2clogin.com/tfp/ziidmsapp.onmicrosoft.com/B2C_1A_signup_signin
AuthorityRedirectUrl msal3e2fe1b7-910e-46d2-aa0b-b1da7755d458://auth
'ZiiDMSApp.exe' (CoreCLR: clrhost): Loaded 'E:\ZiiDMS-NextGen\Client\Desktop\ZiiDMSApp\ZiiDMSApp\bin\Debug\net8.0-windows10.0.22621\AppX\Uno.Core.Extensions.Logging.Singleton.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ZiiDMSApp.exe' (CoreCLR: clrhost): Loaded 'E:\ZiiDMS-NextGen\Client\Desktop\ZiiDMSApp\ZiiDMSApp\bin\Debug\net8.0-windows10.0.22621\AppX\CommonServiceLocator.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
PermissionsScreenName is null or empty SetPermissionControls will not be called
'ZiiDMSApp.exe' (CoreCLR: clrhost): Loaded 'E:\ZiiDMS-NextGen\Client\Desktop\ZiiDMSApp\ZiiDMSApp\bin\Debug\net8.0-windows10.0.22621\AppX\Microsoft.Identity.Client.Extensions.Msal.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ZiiDMSApp.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.8\System.IO.FileSystem.Watcher.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ZiiDMSApp.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.8\System.Collections.Specialized.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ZiiDMSApp.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App\8.0.8\System.Security.Cryptography.ProtectedData.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
MSAL: Always False MSAL 4.63.0.0 MSAL.NetCore .NET 8.0.8 Microsoft Windows 10.0.22631 [2024-09-18 05:48:20Z] [Internal cache] Clearing user token cache accessor.
MSAL: Always False MSAL 4.63.0.0 MSAL.NetCore .NET 8.0.8 Microsoft Windows 10.0.22631 [2024-09-18 05:48:20Z] [Internal cache] Total number of cache partitions found while getting refresh tokens: 0
MSAL: Info False MSAL 4.63.0.0 MSAL.NetCore .NET 8.0.8 Microsoft Windows 10.0.22631 [2024-09-18 05:48:20Z - c8b05dd3-8834-4c40-b8c6-4c2718affe93] Skipping Instance discovery for B2C authority because it is not supported.
MSAL: Info False MSAL 4.63.0.0 MSAL.NetCore .NET 8.0.8 Microsoft Windows 10.0.22631 [2024-09-18 05:48:20Z - c8b05dd3-8834-4c40-b8c6-4c2718affe93] [Instance Discovery] Skipping Instance discovery for non-AAD authority.
MSAL: Info False MSAL 4.63.0.0 MSAL.NetCore .NET 8.0.8 Microsoft Windows 10.0.22631 [2024-09-18 05:48:20Z] Found 0 cache accounts and 0 broker accounts
MSAL: Info False MSAL 4.63.0.0 MSAL.NetCore .NET 8.0.8 Microsoft Windows 10.0.22631 [2024-09-18 05:48:20Z] Returning 0 accounts
MSAL: Always False MSAL 4.63.0.0 MSAL.NetCore .NET 8.0.8 Microsoft Windows 10.0.22631 [2024-09-18 05:48:20Z] [Internal cache] Clearing user token cache accessor.
MSAL: Always False MSAL 4.63.0.0 MSAL.NetCore .NET 8.0.8 Microsoft Windows 10.0.22631 [2024-09-18 05:48:20Z] [Internal cache] Total number of cache partitions found while getting refresh tokens: 0
MSAL: Info False MSAL 4.63.0.0 MSAL.NetCore .NET 8.0.8 Microsoft Windows 10.0.22631 [2024-09-18 05:48:20Z - 7cba51d7-3401-482e-adcc-44d1dcd6f61d] Skipping Instance discovery for B2C authority because it is not supported.
MSAL: Info False MSAL 4.63.0.0 MSAL.NetCore .NET 8.0.8 Microsoft Windows 10.0.22631 [2024-09-18 05:48:20Z - 7cba51d7-3401-482e-adcc-44d1dcd6f61d] [Instance Discovery] Skipping Instance discovery for non-AAD authority.
MSAL: Info False MSAL 4.63.0.0 MSAL.NetCore .NET 8.0.8 Microsoft Windows 10.0.22631 [2024-09-18 05:48:20Z] Found 0 cache accounts and 0 broker accounts
MSAL: Info False MSAL 4.63.0.0 MSAL.NetCore .NET 8.0.8 Microsoft Windows 10.0.22631 [2024-09-18 05:48:20Z] Returning 0 accounts
MSAL: Info False MSAL 4.63.0.0 MSAL.NetCore .NET 8.0.8 Microsoft Windows 10.0.22631 [2024-09-18 05:48:20Z - a3957b6e-b482-44c7-8a4c-a7218dbcb4c2] MSAL MSAL.NetCore with assembly version '4.63.0.0'. CorrelationId(a3957b6e-b482-44c7-8a4c-a7218dbcb4c2)
MSAL: Info False MSAL 4.63.0.0 MSAL.NetCore .NET 8.0.8 Microsoft Windows 10.0.22631 [2024-09-18 05:48:20Z - a3957b6e-b482-44c7-8a4c-a7218dbcb4c2] === AcquireTokenSilent Parameters ===
MSAL: Info False MSAL 4.63.0.0 MSAL.NetCore .NET 8.0.8 Microsoft Windows 10.0.22631 [2024-09-18 05:48:20Z - a3957b6e-b482-44c7-8a4c-a7218dbcb4c2] LoginHint provided: False
MSAL: Info False MSAL 4.63.0.0 MSAL.NetCore .NET 8.0.8 Microsoft Windows 10.0.22631 [2024-09-18 05:48:20Z - a3957b6e-b482-44c7-8a4c-a7218dbcb4c2] Account provided: False
MSAL: Info False MSAL 4.63.0.0 MSAL.NetCore .NET 8.0.8 Microsoft Windows 10.0.22631 [2024-09-18 05:48:20Z - a3957b6e-b482-44c7-8a4c-a7218dbcb4c2] ForceRefresh: False
MSAL: Info False MSAL 4.63.0.0 MSAL.NetCore .NET 8.0.8 Microsoft Windows 10.0.22631 [2024-09-18 05:48:20Z - a3957b6e-b482-44c7-8a4c-a7218dbcb4c2]
=== Request Data ===
Authority Provided? - True
Scopes - https://XXXX/access_as_user
Extra Query Params Keys (space separated) -
ApiId - AcquireTokenSilent
IsConfidentialClient - False
SendX5C - False
LoginHint ? False
IsBrokerConfigured - False
HomeAccountId - False
CorrelationId - a3957b6e-b482-44c7-8a4c-a7218dbcb4c2
UserAssertion set: False
LongRunningOboCacheKey set: False
Region configured:

MSAL: Info False MSAL 4.63.0.0 MSAL.NetCore .NET 8.0.8 Microsoft Windows 10.0.22631 [2024-09-18 05:48:20Z - a3957b6e-b482-44c7-8a4c-a7218dbcb4c2] === Token Acquisition (SilentRequest) started:
Scopes: https://XXXXX/access_as_user
'ZiiDMSApp.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.8\System.Reflection.Metadata.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
MSAL: Error False MSAL 4.63.0.0 MSAL.NetCore .NET 8.0.8 Microsoft Windows 10.0.22631 [2024-09-18 05:48:20Z - a3957b6e-b482-44c7-8a4c-a7218dbcb4c2] Exception type: Microsoft.Identity.Client.MsalUiRequiredException
, ErrorCode: user_null
HTTP StatusCode 0
CorrelationId a3957b6e-b482-44c7-8a4c-a7218dbcb4c2
To see full exception details, enable PII Logging. See https://aka.ms/msal-net-logging
at Microsoft.Identity.Client.Internal.Requests.Silent.SilentRequest.ExecuteAsync(CancellationToken cancellationToken)
at Microsoft.Identity.Client.Internal.Requests.RequestBase.<>c__DisplayClass11_1.<b__1>d.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.Identity.Client.Utils.StopwatchService.MeasureCodeBlockAsync(Func`1 codeBlock)
at Microsoft.Identity.Client.Internal.Requests.RequestBase.RunAsync(CancellationToken cancellationToken)

Exception thrown: 'Microsoft.Identity.Client.MsalUiRequiredException' in System.Private.CoreLib.dll
MSAL: Info False MSAL 4.63.0.0 MSAL.NetCore .NET 8.0.8 Microsoft Windows 10.0.22631 [2024-09-18 05:48:20Z - 110bfb27-5e09-4fd8-8b2a-7a74a85ec1b6] MSAL MSAL.NetCore with assembly version '4.63.0.0'. CorrelationId(110bfb27-5e09-4fd8-8b2a-7a74a85ec1b6)
MSAL: Info False MSAL 4.63.0.0 MSAL.NetCore .NET 8.0.8 Microsoft Windows 10.0.22631 [2024-09-18 05:48:20Z - 110bfb27-5e09-4fd8-8b2a-7a74a85ec1b6] === InteractiveParameters Data ===
LoginHint provided: False
User provided: False
UseEmbeddedWebView: NotSpecified
ExtraScopesToConsent:
Prompt: login
HasCustomWebUi: False
MSAL: Info False MSAL 4.63.0.0 MSAL.NetCore .NET 8.0.8 Microsoft Windows 10.0.22631 [2024-09-18 05:48:20Z - 110bfb27-5e09-4fd8-8b2a-7a74a85ec1b6]
=== Request Data ===
Authority Provided? - True
Scopes - https:/XXXXXXX/access_as_user
Extra Query Params Keys (space separated) -
ApiId - AcquireTokenInteractive
IsConfidentialClient - False
SendX5C - False
LoginHint ? False
IsBrokerConfigured - False
HomeAccountId - False
CorrelationId - 110bfb27-5e09-4fd8-8b2a-7a74a85ec1b6
UserAssertion set: False
LongRunningOboCacheKey set: False
Region configured:

MSAL: Info False MSAL 4.63.0.0 MSAL.NetCore .NET 8.0.8 Microsoft Windows 10.0.22631 [2024-09-18 05:48:20Z - 110bfb27-5e09-4fd8-8b2a-7a74a85ec1b6] === Token Acquisition (InteractiveRequest) started:
Scopes: https://ZiiDMSAPP.onmicrosoft.com/ZiiDMSWebApi/access_as_user
MSAL: Info False MSAL 4.63.0.0 MSAL.NetCore .NET 8.0.8 Microsoft Windows 10.0.22631 [2024-09-18 05:48:20Z - 110bfb27-5e09-4fd8-8b2a-7a74a85ec1b6] [Instance Discovery] Skipping Instance discovery for non-AAD authority.
MSAL: Error False MSAL 4.63.0.0 MSAL.NetCore .NET 8.0.8 Microsoft Windows 10.0.22631 [2024-09-18 05:48:20Z - 110bfb27-5e09-4fd8-8b2a-7a74a85ec1b6] Exception type: System.IO.FileNotFoundException
To see full exception details, enable PII Logging. See https://aka.ms/msal-net-logging
at Microsoft.Identity.Client.Desktop.WebView2WebUi.WebView2WebUiFactory.IsWebView2Available()
at Microsoft.Identity.Client.Desktop.WebView2WebUi.WebView2WebUiFactory.CreateAuthenticationDialog(CoreUIParent coreUIParent, WebViewPreference useEmbeddedWebView, RequestContext requestContext)
at Microsoft.Identity.Client.Internal.AuthCodeRequestComponent.CreateWebAuthenticationDialog()
at Microsoft.Identity.Client.Internal.AuthCodeRequestComponent.FetchAuthCodeAndPkceVerifierAsync(CancellationToken cancellationToken)
at Microsoft.Identity.Client.Internal.Requests.InteractiveRequest.GetTokenResponseAsync(CancellationToken cancellationToken)
at Microsoft.Identity.Client.Internal.Requests.InteractiveRequest.ExecuteAsync(CancellationToken cancellationToken)
at Microsoft.Identity.Client.Internal.Requests.RequestBase.<>c__DisplayClass11_1.<b__1>d.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.Identity.Client.Utils.StopwatchService.MeasureCodeBlockAsync(Func`1 codeBlock)
at Microsoft.Identity.Client.Internal.Requests.RequestBase.RunAsync(CancellationToken cancellationToken)

Exception thrown: 'System.IO.FileNotFoundException' in System.Private.CoreLib.dll
Could not load file or assembly 'Microsoft.Web.WebView2.Core, Version=1.0.864.35, Culture=neutral, PublicKeyToken=2a8ab48044d2601e'. The system cannot find the file specified.

Relevant code snippets

No response

Expected behavior

Expect it to work like the WinAppSDK 1.5 version which popups the login window

Identity provider

Azure B2C Custom Policy

Regression

No response

Solution and workarounds

No response

@cconner100 cconner100 added needs attention Delete label after triage untriaged Do not delete. Needed for Automation labels Sep 18, 2024
@cconner100
Copy link
Author

If i change my code to use WithDefaultREdirectUri and not with the browserredirect it works. But it would be nice to have the older code work again

@iulico-1 iulico-1 removed the untriaged Do not delete. Needed for Automation label Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs attention Delete label after triage public-client
Projects
None yet
Development

No branches or pull requests

4 participants