-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Demo 4-WebApp-Your-API Application ID URI should be https pattern #336
Comments
hi @TiagoBrenck thanks for pointing out where the document is. Yes, I need to support both org and personal accounts. According to your answer, the Application ID URI should be the https pattern. But the referenced document does not mention https or api:// at all. One more thing to point out, I can see Microsoft has poured tremendous efforts on documentations, I really appreciate that as it makes our lives easier. But as the more and more documents written, the new documents and the old ones are co-existing and there are so many documents there which confused me a lot. Take the Microsoft Identity Platform as an example, all I need to do is to fetch emails from user's Hotmail using OBO flow, and I have a separated API project and a Reactjs project. I searched days and nights and found heaps of documents and in the end, the Javascript demo project doesn't even work in Firefox, only working in Edge. so some of documents are lack of love. |
Hi @franva, I am sorry for causing even more confusion. So, the doc statement: "urn:// schemes are not supported" is the restriction that affects api://<>. Then, you should use another pattern, like the https:<> one. We have this sample that is a WebAPI using OBO flow with personal accounts (hotmail, xbox live etc). It might be worthy exploring it. About the documentation feedback, I will forward it to the docs team. Could you share the Javascript demo link for me please? |
Thanks @TiagoBrenck I am still trying to find out an up-to-date example which fits my requirements. There are so many documents, but none of them works for me. I'm lost in the sea of out-of-date documents. What I want is Reactjs + AspNet Core WebApi to fetch user's emails and just found this repo: But it's empty. Please help. |
Hi @franva I would like to apologize for a confusion about the MSA and api:// pattern. Due to a miscommunication, we told you that api:// is not supported for MSA however it is. We will update the sample to remove this miss information. It was actually a bug but it got fixed already. Could you let me know if you manged to have your MSA scenario working? Thanks |
thanks @TiagoBrenck for the update. Unfortunately, no. I have been stuck here for about 4 weeks. I have put my question here: If you could have a look, that would be great. Thanks |
Your scenario is on-behalf-of flow, so the web api configuration is different than the one in this repo. Your WebAPI configuration on AzureAD should follow this: https://github.com/Azure-Samples/active-directory-dotnet-native-aspnetcore-v2/tree/master/2.%20Web%20API%20now%20calls%20Microsoft%20Graph#register-the-service-app-todolistservice. Make sure to set Another observation is that |
thanks @TiagoBrenck for pointing out the correct example to follow. I checked my app registration for my API project on Azure, it's almost identical to the one you provided(https://github.com/Azure-Samples/active-directory-dotnet-native-aspnetcore-v2/tree/master/2.%20Web%20API%20now%20calls%20Microsoft%20Graph#register-the-service-app-todolistservice) EXCEPT the Application ID URI. So it seems that all discussions come back to my first question :) Why should I follow the dotnet-native example rather than the aspnetcore example, as in my case I am using Angular app, instead of the WPF client? Also, in my Web Api and Client App(Angular), I am using the same Client Id as recommended by derisen at here, so for the client app, should I also follow the example you provided for its Azure registration? I do not understand your last sentence : "It work on your API action results" Once again, I appreciate your help. |
I updated my SPA request to use:
And here is the configuration for the SPA and here is the config for Web Api: |
Should I use http:// pattern or the api:// patter? I am now totally lost >_<; Why should I follow the dotnet-native example rather than the aspnetcore example, as in my case I am using Angular app, instead of the WPF client? If I keep using same Client Id, do I still need to set knownClientApplications to include the WebApi App ID? Did you want to say: it doesn't work on your API action results? I am a bit confuse with your scenario since I cant see the whole project with the configurations. I am assuming you have a separate project just for the web api, and from the posts you have on Stackoverflow, it seems that you are missing |
hi @TiagoBrenck I think i finally have made some progress. There are 2 ProtectedWebApi in this name. My understanding is, the 1st ProtectedWebApi is my own Web Api and the 2nd ProtectedWebApi is the downstream Microsoft Graph Api? Is my understanding correct? Now, in the TodoListController, I added the following code:
Startup.cs
The added code comes from here On the Angular app side, I added this code: TodoService.ts
todo-view.component.ts
todo-view.component.html, at any proper place, I added this code: Then when I launched the Angular app and signed in, and clicked the Get Emails button, I received a different error: I inspected the exception and found there is no inner exception anymore. The error message is very generic and gives me no clue about what I could do. With the given code here, I think you should be able to reproduce my issue. |
Cool, I think we are making progress. Your understanding about the Could you get what is null in this last screenshot? Is it the variable |
hi @TiagoBrenck the "account" is null, you can see it from the second last screenshot. Cheers, Winston |
@franva would you be able to have a screen sharing session with me, so I can help you troubleshoot this problem? |
@TiagoBrenck thanks man, Yes, sure. I am based in Melbourne Australia, I can do screen sharing after work 6PM, or anytime in weekends. What is your preferred tool to use? Thanks again~! |
hi @TiagoBrenck thanks for your willingness to help. I have tried, I cannot use my own Microsoft account to log into Team and cannot find you if I logged in with my company's account. my email is [email protected] Could you please add me on Skype? or any other means you prefer. Thanks a lot |
This issue is for a: (mark with an
x
)The issue was found for the following scenario:
Please add an 'x' for the scenario(s) where you found an issue
Repro-ing the issue
Repro steps
It asks to
but on the demo Active Directory Aspnetcore Webapp OpenIdConnect V2 4-WebApp-Your-API, section
It asks for
Since they both use Web Api as backend service to serve frontend(one as WPF client, one as Webapp), the configuration for Application ID URI should be same.
Why do they have 2 inconsistent configurations?
I believe, this Application ID URI should be one of them: https or api.
The text was updated successfully, but these errors were encountered: