Asp.net WebForms Silent Authentication AAD on Teams Tab

前提是你 提交于 2019-12-13 19:27:12

问题


I'm looking a way to build a Web Forms App C# 4.7 with Azure Active Directory (AAD) Authentication like a SSO Authentication. This WebApp was deployed on Azure Web Application.

I'Would like to use this site from : Web Browser - all

Teams Tab (adding this to teams as a Tab) -- Working on Web and Desktop App

I'have try 3 option :

1/ Using Azure Web Application Authentication (configuration with our AAD) it's work fine on Web Browser and on Teams Web
But doesn't Work on Teams Desktop App...

2/ Implementation off OWin Auth with AAD V2 OAuth2 on C# code it's work like the 1 option. But doesn't work on Teams Desktop App....

3/ Now I'm looking a way i think this it's good way but i didn't find use on WebForms C# .Net project https://docs.microsoft.com/en-us/microsoftteams/platform/concepts/authentication/auth-tab-aad


回答1:


OAuth is a web-based protocol that relies on redirects between URLs. When your tab is running inside the Teams client, there is no URL to redirect back to, so authentication fails (that's what's happening when you run your tab in the desktop client). You need to have Teams initiate the authentication process for you: you can't do it directly. This method also works in the browser, and the user experience is improved because the login doesn't occur in a separate browser tab, it occurs in a modal popup.

You need to use the tabs SDK method microsoftTeams.authentication.authenticate(). The usage of this is explained in great detail here. (The URL you found is a companion article specific to AAD and doesn't have the overview information.)

There's a C# example here: Microsoft Teams tab authentication sample (C#).



来源:https://stackoverflow.com/questions/51302873/asp-net-webforms-silent-authentication-aad-on-teams-tab

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!