Azure-Samples / communication-services-dotnet-quickstarts

Sample code for Azure Communication Services .Net quickstarts
MIT License
76 stars 104 forks source link

Line 22 of MainPage.xaml.cs of Calling project #132

Closed laultman closed 10 months ago

laultman commented 10 months ago

Please provide us with the following information:

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [x ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

The documentation is incomplete or incorrect. After 2 days of searching the entire suite of documentation for C# teams communications, I am unable to build and test the CallingQuickstart project for UWP. Ironic isn't it that you can spend 18 to 20 hours on a quickstart project. And it still not work.

So finally, I'm breaking down to ask: Where does the value requested in line 22: private const string teamsAuthToken = "";

Bing nor the AI can find any solution to this mysterious bit of critical information.

Any log messages given by the failure

teamsCallAgent = await callClient.CreateTeamsCallAgentAsync(teamsTokenCredential, teamsCallAgentOptions); Productes invalid token.

Expected/desired behavior

Example of or explanation of where the value originates.

OS and Version?

Windows 11 current version, VS2022 current version

Versions

Mention any other details that might be useful


Thanks! We'll be in touch soon.

laultman commented 10 months ago

I found the answer. I could wish you good luck. But as a community supporter, I will give you some more information. Team integration is NOT for the faint of heart! 1- The entire documentation is NOT your typical functional demonstration of getting started. 2- Quickstart does not mean getting an actual app working, it means "a short example of a particular component or feature". 3- The documentation assumes in most places that the reader has a very strong grasp of Azure communications services and makes very little comments on the inter-dependences. 4- The documentation fails to set any user expectations. 5- Generally, links to other technologies required are very good, I will never dispute having links; however, in this case the developer is given links to other resources with almost no context of how or why the linked information is useful. It is up to you to understand.

Now to the actual problem at hand. The code at issue here is in one of the code samples "Calling" by name. If you understand that the documentation is not about building an app or a use case scenario but documentation of necessary parts of Teams to put together your use case, then it begins to make some sense. I apparently needed an authentication token. Short answer, you must generate a token. It is not your AAD (Entra) user token. From my estimation, Teams is an independent system, guessing here, but is a hold-over from its roots as Skype. The number one revelation is that Teams has its own identity store and token services completely independent of AAD (Entra). Teams will accept credentials for many other credential services, and you must devise your own method of using (trusting) the provided credentials. In the end you must generate a Teams identity object and obtain a Teams compatible token. Microsoft did make using AAD easier to consume by creating SDKs but they are different identity stores. Finally, there are two types of "calls" possible with Teams: PSTN (real phone calls) and Teams (VOIP). They use completely different connection types as you might expect and thusly require different credentials. As previously stated, this documentation is about Teams component parts, not about a complete implementation. You will find the necessary capability (C#) on how to create a user token. You must integrate this with other code parts to create your implementation for your purposes in your application in the language of your choice.

laultman commented 10 months ago

Parting comments: Use the quick starts as simple code fragments. You must do your own integration. The quick starts are not complete working code. They are not production ready in any sense.