-
Notifications
You must be signed in to change notification settings - Fork 199
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
Unauthorized error when following "Desktop app calls Web API" instructions #187
Comments
@dpaulino it will work provided you change the audience of your web API to be Accounts in any organizational directory and personal Microsoft accounts (e.g. Skype, Xbox, Outlook.com)
|
I used chapter 1 instructions. That's already the audience of the web API. In fact, the instruction already specifies that audience. But it doesn't work. I'm getting unauthorized error. Is the issue related to my tenant? I'm using my default tenant. Should I create a new tenant? And I haven't seen chapter 3 yet. I can try it. |
For clarity, here is where the instruction says what audience to use: https://github.com/Azure-Samples/active-directory-dotnet-native-aspnetcore-v2/tree/master/1.%20Desktop%20app%20calls%20Web%20API#register-the-service-app-todolistservice-active-directory-dotnet-native-aspnetcore-v2. So how come I'm getting an unauthorized error when I use my personal microsoft account? |
@dpaulino I'm assuming that the token is not validated (and that you don't enter into the controller Get method: You might also want to add PII logging, for instance in the contructor of the Startup.cs, add: IdentityModelEventSource.ShowPII = true; |
Thanks for the update @dpaulino @jennyf19 @henrik-me : let's try to improve the error message if we can at the level of Microsoft.Identity.Web (and possibly MSAL (@jennyf19 @henrik-me @bgavrilMS @trwalke @pmaytak) cc: @lnalepa @SaeedAkhter-MSFT for the feedback ... |
Not sure what fails here, but we need bug in either MSAL or Id.Web to improve the experience. |
This issue is for a: (mark with an
x
)Minimal steps to reproduce
Any log messages given by the failure
Expected/desired behavior
OS and Version?
Versions
Mention any other details that might be useful
I understand that the instructions say "this sample does not work with personal microsoft accounts". What do I have to do in order to protect an API using personal microsoft accounts? This sample is everything that I need, except that I just need to accept personal MSAs from users. Please help!
The text was updated successfully, but these errors were encountered: