question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AcquireTokenInteractive crashes on UWP app for ARM64

See original GitHub issue

Version of Nuget Microsoft.Identity.Client 4.19.0

Platform: UWP on ARM64

In a UWP Desktop App, running on ARM64, we want to authenticate for OneDrive, using the method IPublicClientApplication.AcquireTokenInteractive(…).ExecuteAsync();

Repro

private readonly string[] m_scopes = new[] { "Files.ReadWrite" };

IPublicClientApplication s_publicClientApp = PublicClientApplicationBuilder.Create("MyAppKeyForOneDrive")
					.WithRedirectUri("https://login.microsoftonline.com/common/oauth2/nativeclient")
					.Build();
IEnumerable<IAccount> accounts = await s_publicClientApp.GetAccountsAsync();
IAccount firstAccount = accounts?.FirstOrDefault();
AuthenticationResult authResult;
if (firstAccount != null)
{
	authResult = await s_publicClientApp.AcquireTokenSilent(m_scopes, firstAccount).ExecuteAsync();
}
else
{
	authResult = await s_publicClientApp.AcquireTokenInteractive(m_scopes).ExecuteAsync();
}

Expected behavior User is shown the login popup to enter credentials, and after successful login, the code receives a valid authResult.

Actual behavior On ARM64, the app crashes with an unrecoverable exception in SharedLibrary.dll.

Additional context/ Logs / Screenshots Please note that the very same code works perfectly in x64.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:65 (32 by maintainers)

github_iconTop GitHub Comments

3reactions
tipacommented, Dec 12, 2021

I am also disappointed to hear this issue has been closed without fixing it. This is especially frustrating for new developers picking up this library - they will all run into the same problem eventually. I have read through the whole thread now and haven’t seen an explanation on why a) this cannot be fixed in the library and b) what UseDotNetNativeSharedAssemblyFrameworkPackage actually does and why it is a functioning workaround

If it’s not a bug in the MSAL library, where is the crash originating from then?

2reactions
dpaulinocommented, Dec 13, 2021

@bgavrilMS could your team acquire these arm64 dev kits for testing? https://www.microsoft.com/en-us/d/ecs-liva-mini-box-qc710-desktop/8z247h1h3skp

Read more comments on GitHub >

github_iconTop Results From Across the Web

Crash in UWP app on ARM64 device while executing ...
On ARM64, the app crashes with an exception in SharedLibrary.dll while executing the API AcquireTokenInteractive for MS Feed sign-in.
Read more >
Troubleshooting MSAL.NET
AcquireTokenInteractive crashes in a UWP app for ARM64. Symptom. On ARM64 (for example a Surface Pro X), the app crashes with an unrecoverable ......
Read more >
UWP App crashes when main process tries to get a folder ...
Main Process tries to open that folder to check for new Files. When this happens, while the background process is still accessing the...
Read more >
Crashes when trying to debug uwp application
I've seen the crash happen in diferent places, I've been unable to exactly reproduce the same exception. fixed in: visual studio 2019 version ......
Read more >
admin - davidpritchard.org
Crash Capture: Record Stack Trace. From a UWP app, we don't have access to many Win32 APIs – but we can call CaptureStackBackTrace....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found