Forum Discussion
Authenticate a user in MS teams custom app using asp.net and c#
Hi gk_vasudev ,
Thank you so much for your reply.
Is it possible that user is logged in to MS teams already so it can auto login to custom app pages using same credentials?
As per your answer, user has to login by his Office 365 credentials again in the app.
Thanks,
Rajesh Lohar
if thats the case ,
Then u could a request an authentication token from microsoft teams
and use the token information to authenticate the user to your application.
by this way the user would be automatically logs in to your custom application.
This is "Single Sign-on" Concept based on the "on-behalf-of" flow.
Please go through these links to get a clear idea about the process and how to do it.
its mostly in Js, but i think you would be able to figure out to do it in asp.net and c#
https://docs.microsoft.com/en-us/microsoftteams/platform/tabs/how-to/authentication/auth-aad-sso
https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-on-behalf-of-flow#service-to-service-access-token-request
https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-v2-protocols