-
Notifications
You must be signed in to change notification settings - Fork 174
Expand file tree
/
Copy pathCardExtensions.cs
More file actions
31 lines (28 loc) · 931 Bytes
/
CardExtensions.cs
File metadata and controls
31 lines (28 loc) · 931 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using Microsoft.Bot.Schema;
using System.Collections.Generic;
namespace Bot.Builder.Community.Middleware.AzureAdAuthentication
{
public static class CardExtensions
{
public static void AddSignInCard(this Activity activity, string url)
{
activity.Attachments = new List<Attachment>() { CreateSignInCard(url) };
}
private static Attachment CreateSignInCard(string url)
{
return new SigninCard()
{
Text = "Please sign in with your Office 365 account to continue",
Buttons = new List<CardAction>()
{
new CardAction()
{
Type = ActionTypes.Signin,
Title = "Sign in",
Value = url
}
}
}.ToAttachment();
}
}
}