hitek avatar image
0 Votes"
hitek asked RoyLi-MSFT commented

Quickstart: Call the Microsoft Graph API from a Universal Windows Platform (UWP) application

Good day!

I attempted to the Quickstart: Call the Microsoft Graph API from a Universal Windows Platform (UWP) application. I took several approaches and came up with the same issue.

 Error Acquiring Token:
  ErrorCode: authentication_ui_failed
 Microsoft.Identity.Client.MsalClientException: Web Authentication Broker (WAB) authentication failed. To collect WAB logs, please follow ---> System.Exception: The process terminated unexpectedly. (Exception from HRESULT: 0x8007042B)

I started here:
Created and registered a new app as stated in Step 1. Downloaded the code in Step 2. Made the ClientID change in Step 3. Executed in Step 4 and pressed the button to MS Graph. I received the error.

Then I went back to Azure Portal/AD and created a new Registration, I used the Quickstart navigation link and chose a UWP solution. Accepted the Redirect URI suggestion and downloaded the app with my new clientId embedded already in the code.

I have to admit, that is pretty cool!!!!

I also made sure User.Read was available.

Yet, I still got the error.

It has to be something simple. But what? I also made sure User.Read was available.


· 6
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I made a test following the document you provide Quickstart: Call the Microsoft Graph API from a Universal Windows Platform (UWP) application, but I could call the Graph API correctly. One thing that might be an issue is that when I download the sample in Step2 with the provided link, I double-checked the Client ID in the code with the Application ID in the Azure portal. I found it's not the same one. I need to manually change the Client ID to the one I registered. Could you please check if this is the key point?

0 Votes 0 ·

Thanks for responding.

I tried what you asked and in my testing I have validated it is the same App Id. I even went so far as to generate a Windows Desktop APP (WFP) and used the same ID and it worked just fine. But not in the UWP app. It seems strange. I walked through each code side by side on different monitors and it looks like essentially the same code.

0 Votes 0 ·

I just attempted both UPW and WPF on a different box. They both work. Something must be wrong on the other box in a package or something else. I'll dig in more later and report.

0 Votes 0 ·

I'm a little confused about the work 'a different box'. Do you mean on another device?

0 Votes 0 ·

Yes, I mean another device. Sorry for the lack of clarity.

0 Votes 0 ·
Show more comments

0 Answers