Teams Desktop not allowing request to protected Azure WebAPI

%3CLINGO-SUB%20id%3D%22lingo-sub-3494001%22%20slang%3D%22en-US%22%3ETeams%20Desktop%20not%20allowing%20request%20to%20protected%20Azure%20WebAPI%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3494001%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSTRONG%3EScenario%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3EI%20have%20a%20simple%20application%20setup.%20An%20Angular%20SPA%20front-end%20and%20an%20ASP.NET%20Core%20WebAPI.%20The%20Angular%20front-end%20application%20has%20been%20registered%20and%20loaded%20into%20Microsoft%20Teams.%20One%20of%20the%20Angular%20app's%20features%20is%20to%20request%20data%20from%20an%20Azure%20hosted%20ASP.NET%20Core%20WebAPI.%20The%20WebAPI%20is%20protected%20using%20Microsoft%20Identity%20Platform.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EIssue%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3EIn%20the%20Microsoft%20Teams%20%3CSTRONG%3EWEB%3C%2FSTRONG%3E%20application%20all%20is%20worked%20as%20expected.%20The%20SSO%20service%20I've%20created%20works%20and%20MSAL%20in%20the%20Angular%20App%20is%20picking%20up%20the%20access_token%20and%20successfully%20authenticates%20to%20the%20ASP.NET%20Core%20WebAPI%20to%20retrieve%20the%20protected%20payload.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWHY%20IS%20THIS%20NOT%20WORKING%20INSIDE%20THE%20TEAMS%20%3CSTRONG%3EDESKTOP%3C%2FSTRONG%3E%20APPLICATION%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20does%20work%20is%20making%20a%20request%20to%20a%20PUBLIC%20(un-protected)%20webapi.%20But%20for%20PROD%2C%20this%20is%20NOT%20an%20option.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPlease%20help!%20I've%20been%20working%20on%20this%20for%20too%20long.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERegards%2C%3C%2FP%3E%3CP%3ETolga%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3494001%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAuthentication%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%20Desktop%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3498382%22%20slang%3D%22en-US%22%3ERe%3A%20Teams%20Desktop%20not%20allowing%20request%20to%20protected%20Azure%20WebAPI%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3498382%22%20slang%3D%22en-US%22%3E%3CP%3Ekemaltolga%20-%20Could%20you%20please%20refer%20below%20sample%20and%20let%20us%20know%20if%20you%20have%20any%20query.%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FOfficeDev%2FMicrosoft-Teams-Samples%2Ftree%2Fmain%2Fsamples%2Ftab-sso%2Fcsharp%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EMicrosoft-Teams-Samples%2Fsamples%2Ftab-sso%2Fcsharp%20at%20main%20%C2%B7%20OfficeDev%2FMicrosoft-Teams-Samples%20(github.com)%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3519970%22%20slang%3D%22en-US%22%3ERe%3A%20Teams%20Desktop%20not%20allowing%20request%20to%20protected%20Azure%20WebAPI%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3519970%22%20slang%3D%22en-US%22%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1392044%22%20target%3D%22_blank%22%3E%40kemaltolga%3C%2FA%3E%20-%20Could%20you%20please%20confirm%20is%20your%20issue%20resolved%20or%20are%20you%20still%20facing%20the%20issue.%3C%2FLINGO-BODY%3E
New Contributor

Scenario

I have a simple application setup. An Angular SPA front-end and an ASP.NET Core WebAPI. The Angular front-end application has been registered and loaded into Microsoft Teams. One of the Angular app's features is to request data from an Azure hosted ASP.NET Core WebAPI. The WebAPI is protected using Microsoft Identity Platform. 

 

Issue

In the Microsoft Teams WEB application all is worked as expected. The SSO service I've created works and MSAL in the Angular App is picking up the access_token and successfully authenticates to the ASP.NET Core WebAPI to retrieve the protected payload. 

 

WHY IS THIS NOT WORKING INSIDE THE TEAMS DESKTOP APPLICATION?

 

What does work is making a request to a PUBLIC (un-protected) webapi. But for PROD, this is NOT an option. 

 

Please help! I've been working on this for too long.

 

Regards,

Tolga

 

 

 

2 Replies

kemaltolga - Could you please refer below sample and let us know if you have any query.
Microsoft-Teams-Samples/samples/tab-sso/csharp at main · OfficeDev/Microsoft-Teams-Samples (github.c...

@kemaltolga - Could you please confirm is your issue resolved or are you still facing the issue.