简体   繁体   中英

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. 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

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#) .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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