Microsoft Tech Community Live:  Microsoft Teams Edition
November 09, 2021, 08:00 AM - 12:00 PM (PST)
SOLVED

Bot Authentication on Adaptive Card button click event

%3CLINGO-SUB%20id%3D%22lingo-sub-2716921%22%20slang%3D%22en-US%22%3EBot%20Authentication%20on%20Adaptive%20Card%20button%20click%20event%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2716921%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20All%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOur%20application%20used%20to%20send%20notification%20as%20adaptive%20card%2C%20to%20MS%20Teams%20users%20via%20bot.%20The%20application%20has%20been%20developed%20through%20C%23.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20button%20click%20should%20perform%20bot%20authentication.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWe%20have%20created%20a%20button%20with%20the%20below%20code.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EActions%20%3D%3CBR%20%2F%3E%7B%3CBR%20%2F%3Enew%20AdaptiveSubmitAction()%3CBR%20%2F%3E%7B%3CBR%20%2F%3EType%20%3D%20AdaptiveSubmitAction.TypeName%2C%3CBR%20%2F%3ETitle%20%3D%20%22Click%20Here%22%2C%3CBR%20%2F%3E%7D%2C%3CBR%20%2F%3E%7D%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHow%20to%20add%20the%20bot%20authentication%20on%20button%20click%20event%20of%20adaptive%20card%3F%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EKindly%20suggest.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2716921%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2723681%22%20slang%3D%22en-US%22%3ERe%3A%20Bot%20Authentication%20on%20Adaptive%20Card%20button%20click%20event%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2723681%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1023459%22%20target%3D%22_blank%22%3E%40maheshkumargunasekaran%3C%2FA%3E%26nbsp%3B%3CBR%20%2F%3E%3CCODE%3ESignin%3C%2FCODE%3E%3CSPAN%3E%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoftteams%2Fplatform%2Ftask-modules-and-cards%2Fcards%2Fcards-actions%3Ftabs%3Dcsharp%23adaptive-cards-with-signin-action%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3Eaction%3C%2FA%3E%20type%20initiates%20an%20OAuth%20flow%20that%20permits%20bots%20to%20connect%20with%20secure%20services.%3CBR%20%2F%3E%3C%2FSPAN%3EPlease%20follow%20below%20documentation%20to%20see%20how%20the%20flow%20works%3A%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoftteams%2Fplatform%2Fbots%2Fhow-to%2Fauthentication%2Fauth-flow-bot%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EMicrosoft%20Teams%20Authentication%20flow%20for%20bots%20-%20Teams%20%7C%20Microsoft%20Docs%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2727093%22%20slang%3D%22en-US%22%3ERe%3A%20Bot%20Authentication%20on%20Adaptive%20Card%20button%20click%20event%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2727093%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%20class%3D%22TextRun%20SCXO4507646%20BCX8%22%20data-contrast%3D%22auto%22%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXO4507646%20BCX8%22%3EIf%20the%20response%20is%20helpful%2C%20please%20click%20%22**Mark%20as%20Best%20Response**%22%20and%20like%20it.%20You%20can%20share%20your%20feedback%20via%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3CA%20class%3D%22Hyperlink%20SCXO4507646%20BCX8%22%20href%3D%22https%3A%2F%2Faka.ms%2FDevSupportFeedback)%22%20target%3D%22_blank%22%20rel%3D%22noreferrer%20noopener%22%3E%3CSPAN%20class%3D%22TextRun%20SCXO4507646%20BCX8%22%20data-contrast%3D%22auto%22%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXO4507646%20BCX8%22%3EMicrosoft%20Teams%20Developer%20Feedback%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FA%3E%3CSPAN%20class%3D%22TextRun%20SCXO4507646%20BCX8%22%20data-contrast%3D%22auto%22%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXO4507646%20BCX8%22%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Elink.%20Click%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3CA%20class%3D%22Hyperlink%20SCXO4507646%20BCX8%22%20href%3D%22https%3A%2F%2Faka.ms%2FDevCommunityEscalationForm%22%20target%3D%22_blank%22%20rel%3D%22noreferrer%20noopener%22%3E%3CSPAN%20class%3D%22TextRun%20SCXO4507646%20BCX8%22%20data-contrast%3D%22auto%22%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXO4507646%20BCX8%22%3Ehere%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FA%3E%3CSPAN%20class%3D%22TextRun%20SCXO4507646%20BCX8%22%20data-contrast%3D%22auto%22%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXO4507646%20BCX8%22%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eto%20escalate.%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22EOP%20SCXO4507646%20BCX8%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Hi All,

 

Our application used to send notification as adaptive card, to MS Teams users via bot. The application has been developed through C#.

 

The button click should perform bot authentication.

 

We have created a button with the below code.

 

Actions =
{
new AdaptiveSubmitAction()
{
Type = AdaptiveSubmitAction.TypeName,
Title = "Click Here",
},
},

 

How to add the bot authentication on button click event of adaptive card? 

 

Kindly suggest.

2 Replies
best response confirmed by maheshkumargunasekaran (Occasional Contributor)
Solution

@maheshkumargunasekaran 
Signin action type initiates an OAuth flow that permits bots to connect with secure services.
Please follow below documentation to see how the flow works:
Microsoft Teams Authentication flow for bots - Teams | Microsoft Docs


You can share your 
Feedback/Escalate 

Thanks, 

Prasad Das 

Teams Dev Community Response 

If the response is helpful, please click "**Mark as Best Response**" and like it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.