Issue with authentication in Teams Personal tab application

Copper Contributor

Hi,
I have an issue with authentication in my Teams Personal tab application. There is some weird behaviour with authentication flow when I`m testing my app in Teams Desktop Client (web-based client works just fine).
So I am using .netcore web application with IdentityServer4 to handle authentication. I have a few identity providers (google etc.).

 

The authentication flow is as follows:

1. User is trying to access my applicaton.
2. If user is authenticaten (auth cookies are present) then it`s just getting redirected to the application.
3. If user isn`t authenticated then redirect to the login page.

 

Is pretty straitforward and have been working perfectly so far. It is also working properly for my Teams personal app if I am working with it via my browser (chrome/edge/firefox).
The problem starts when I`m trying to login from my Teams Desktop Client. I am always getting redirected to my login page whether I haved already logged in or not.
My first thought was that the Desktop is just doesn`t works with cookies but after some research I found out that Desktop Client is actually a stripped out browser.
I have been trying to fix this problem for days but without luck. Have someone experienced something similar?

2 Replies

@ivjunka1760Could you please refer to and test the sample below, which includes tab authentication:

Microsoft-Teams-Samples/samples/tab-sso/csharp at main · OfficeDev/Microsoft-Teams-Samples · GitHub

Please let us know if you encounter the same issue again while working with this sample.

@ivjunka1760Have you tested the tab-sso sample? Please let us know if you have any further issues here.