简体   繁体   English

团队选项卡上的Asp.net WebForms静默身份验证AAD

[英]Asp.net WebForms Silent Authentication AAD on Teams Tab

I'm looking a way to build a Web Forms App C# 4.7 with Azure Active Directory (AAD) Authentication like a SSO Authentication. 我正在寻找一种使用Azure Active Directory(AAD)身份验证(如SSO身份验证)构建Web Forms App C#4.7的方法。 This WebApp was deployed on Azure Web Application. 此WebApp部署在Azure Web应用程序上。

I'Would like to use this site from : Web Browser - all 我想使用以下网站:Web浏览器-全部

Teams Tab (adding this to teams as a Tab) -- Working on Web and Desktop App 团队选项卡(将其作为选项卡添加到团队)-在Web和桌面应用程序上工作

I'have try 3 option : 我尝试了3种选择:

1/ Using Azure Web Application Authentication (configuration with our AAD) it's work fine on Web Browser and on Teams Web 1 /使用Azure Web应用程序身份验证(通过AAD进行配置),可以在Web浏览器和Teams Web上正常工作
But doesn't Work on Teams Desktop App... 但不适用于Teams Desktop应用...

2/ Implementation off OWin Auth with AAD V2 OAuth2 on C# code it's work like the 1 option. 2 /在C#代码上使用AAD V2 OAuth 2关闭OWin Auth的实现,其工作方式类似于1选项。 But doesn't work on Teams Desktop App.... 但是在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 3 /现在我正在寻找一种我认为这是一种好方法的方法,但是我没有在WebForms C#.Net项目上找到用处https://docs.microsoft.com/zh-cn/microsoftteams/platform/concepts/authentication/ AUTH-制表AAD

OAuth is a web-based protocol that relies on redirects between URLs. OAuth是基于Web的协议,依赖于URL之间的重定向。 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). 当选项卡在Teams客户端中运行时,没有URL可以重定向回,因此身份验证失败(这是在桌面客户端中运行选项卡时发生的情况)。 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() . 您需要使用选项卡SDK方法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.) (您找到的URL是AAD的配套文章,没有概述信息。)

There's a C# example here: Microsoft Teams tab authentication sample (C#) . 这里有一个C#示例: Microsoft Teams选项卡身份验证示例(C#)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM