SOLVED

How to get a custom .Net app with forms auth to work

Iron Contributor

We have an existing Azure dotnet app that simply uses traditional asp.net forms authentication.  The app service itself is set to anonymous access. We would like to add it into Teams as an alternative access point for users but after trying we've hit a problem that the custom authentication page doesn't seem to be able to set the cookie on a successful submit and the user stays on the login page rather than being redirected. Does the app have to be modified in some way for this to work?

4 Replies

@Ryan Stone , Have you implemented Teams authentication in your .net forms app?

You need to use the tabs SDK method microsoftTeams.authentication.authenticate(). Please look at here for more detail https://docs.microsoft.com/en-us/microsoftteams/platform/concepts/authentication/auth-flow-tab. There's a C# example here: Microsoft Teams tab authentication sample (C#).

@Trinetra-MSFT thank you for the response. Why would this be needed though if the app is not using Azure AD or an identify provider like that, and is not making any external API calls?  It's completely self-contained app with anonymous access and traditional built-in forms authentication.  Is all this still required?

best response confirmed by Ryan Stone (Iron Contributor)
Solution

@Ryan Stone I think that this documentation will help you https://docs.microsoft.com/en-us/microsoftteams/platform/resources/samesite-cookie-update.

I think that the problem is related the chromium engine used by Teams and the fact that you are app is embedded in an iframe

@Alexis CONIA thank you!  That makes complete sense.

1 best response

Accepted Solutions
best response confirmed by Ryan Stone (Iron Contributor)
Solution

@Ryan Stone I think that this documentation will help you https://docs.microsoft.com/en-us/microsoftteams/platform/resources/samesite-cookie-update.

I think that the problem is related the chromium engine used by Teams and the fact that you are app is embedded in an iframe

View solution in original post