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


We have an existing Azure dotnet app that simply uses traditional 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 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 (Contributor)

@Ryan Stone I think that this documentation will help you

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.