Skip to content
This repository was archived by the owner on Jun 17, 2024. It is now read-only.

Support for Visual Studio Online (VSO) authentication #1

Open
wants to merge 60 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
e463cea
Updating Graph ResourceId
tiagonmas Jul 14, 2016
d49bad2
Merge pull request #1 from matvelloso/master
tiagonmas Jul 20, 2016
4c24401
Added Visual Studio Online oAuth2 support
tiagonmas Jul 20, 2016
c4266e0
VSO authentication Implementation
tiagonmas Jul 20, 2016
5b657f2
Added files tu support VSO oAuth2 authentication
tiagonmas Jul 20, 2016
bf0e882
Furthere the implementation of VSO authentication
tiagonmas Jul 21, 2016
10e64f6
processing AuthResults and storing token
tiagonmas Jul 21, 2016
7a2dc14
Removed code that was commented. removed expiresIn auth result from V…
tiagonmas Jul 21, 2016
81ced6a
Converted some internal method from Public to Private. Added method t…
tiagonmas Jul 21, 2016
efcc51f
Reverted SampleAADv1Bot to original code. Created Sample project Ssam…
tiagonmas Jul 22, 2016
56061ed
sorted some dependencies issues
tiagonmas Jul 22, 2016
b140d03
added code to get work items from vso
tiagonmas Aug 1, 2016
ffe93dd
Implement refresh VSO token, Scopes read from webconfig. Token comman…
tiagonmas Aug 3, 2016
2f33523
Changed TokenSample to GetTokenINfo so it only shows information abou…
tiagonmas Aug 4, 2016
621ba5d
Updated way to query TFS, in order to use .Net client library instead…
tiagonmas Oct 7, 2016
eb044de
Merging with matv main rep
tiagonmas Oct 7, 2016
a928d6a
Merging with MatV main rep
tiagonmas Oct 7, 2016
5c9ee40
merging with Matt
tiagonmas Oct 7, 2016
8303bba
Revert "merging with Matt"
tiagonmas Oct 7, 2016
ee9b7b8
sorting dependencies issues after mergint with Mat
tiagonmas Oct 11, 2016
3eadc8d
continuation of MErge with Mat
tiagonmas Oct 11, 2016
1809adc
final changes resulting merge with Mat repo and changes in resumption…
tiagonmas Oct 12, 2016
5196fe9
Merged with Mat and listinf projects from TFS. Skype sigin too.
tiagonmas Oct 13, 2016
9ff0182
Update README.md
tiagonmas Oct 13, 2016
280254f
Create SampleVSOBot.md
tiagonmas Oct 13, 2016
a759942
Update SampleVSOBot.md
tiagonmas Oct 13, 2016
47b090a
Picture of VSO Sample Bot in action
tiagonmas Oct 13, 2016
7138dc0
Update SampleVSOBot.md
tiagonmas Oct 13, 2016
689dd0b
Add files via upload
tiagonmas Oct 13, 2016
f5e1e25
Delete VSOBotCapture.PNG
tiagonmas Oct 13, 2016
76d6d5b
Add files via upload
tiagonmas Oct 13, 2016
1904444
deleting image
tiagonmas Oct 13, 2016
6dd3f34
Add files via upload
tiagonmas Oct 13, 2016
dcf0428
Update SampleVSOBot.md
tiagonmas Oct 13, 2016
079777c
Update SampleVSOBot.md
tiagonmas Oct 13, 2016
fa253e1
Update SampleVSOBot.md
tiagonmas Oct 13, 2016
eab70f3
Update SampleVSOBot.md
tiagonmas Oct 13, 2016
3e519dc
Update SampleVSOBot.md
tiagonmas Oct 13, 2016
082556c
Update SampleVSOBot.md
tiagonmas Oct 13, 2016
dc862ea
Update SampleVSOBot.md
tiagonmas Oct 13, 2016
d756501
Update SampleVSOBot.md
tiagonmas Oct 13, 2016
925afab
Update SampleVSOBot.md
tiagonmas Oct 13, 2016
c882b89
Update SampleVSOBot.md
tiagonmas Oct 13, 2016
121f176
Update SampleVSOBot.md
tiagonmas Oct 13, 2016
8b1145e
Add files via upload
tiagonmas Oct 13, 2016
f91b968
Update SampleVSOBot.md
tiagonmas Oct 13, 2016
d53109b
Update SampleVSOBot.md
tiagonmas Oct 13, 2016
e804ef7
Update SampleVSOBot.md
tiagonmas Oct 13, 2016
c38ad3c
Update SampleVSOBot.md
tiagonmas Oct 13, 2016
22a864c
Update SampleVSOBot.md
tiagonmas Oct 13, 2016
79d662e
Update SampleVSOBot.md
tiagonmas Oct 13, 2016
84ee988
Update README.md
tiagonmas Oct 13, 2016
cb9ccac
Update README.md
tiagonmas Oct 13, 2016
f70d27a
Update README.md
tiagonmas Oct 13, 2016
4577e3b
Update README.md
tiagonmas Oct 13, 2016
3b24c7c
Update README.md
tiagonmas Oct 13, 2016
62979c7
Update SampleVSOBot.md
tiagonmas Oct 13, 2016
e7a0b09
Update SampleVSOBot.md
tiagonmas Oct 13, 2016
eb7e196
Reverting other 3 sample projects to same as origin to avoid conflicts
tiagonmas Oct 13, 2016
e7f3649
Merge branch 'master' of https://github.com/tiagonmas/AuthBot
tiagonmas Oct 13, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Reverted SampleAADv1Bot to original code. Created Sample project Ssam…
…pleVSOBot. Implemented Logout flow in AuthBot
tiagonmas committed Jul 22, 2016
commit efcc51fe87b490c7c403813c97a9485d67adba00
9 changes: 6 additions & 3 deletions AuthBot.sln
Original file line number Diff line number Diff line change
@@ -11,6 +11,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OneDriveBot", "OneDriveBot\
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleAADv1Bot", "SampleAADv1Bot\SampleAADv1Bot.csproj", "{D2253234-1279-486E-8A63-D8C3424E0525}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleVSOBot", "SampleVSOBot\SampleVSOBot.csproj", "{A8BA1066-5695-4D71-ABB4-65E5A5E0C3D4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -22,17 +24,18 @@ Global
{B8AD59D3-C36D-4E18-B504-06871001BC8D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B8AD59D3-C36D-4E18-B504-06871001BC8D}.Release|Any CPU.Build.0 = Release|Any CPU
{DFDC62CE-993B-461E-99DB-F079F46105C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DFDC62CE-993B-461E-99DB-F079F46105C5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DFDC62CE-993B-461E-99DB-F079F46105C5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DFDC62CE-993B-461E-99DB-F079F46105C5}.Release|Any CPU.Build.0 = Release|Any CPU
{44BE2EEE-3F57-44D0-A298-C0967048DAE8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{44BE2EEE-3F57-44D0-A298-C0967048DAE8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{44BE2EEE-3F57-44D0-A298-C0967048DAE8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{44BE2EEE-3F57-44D0-A298-C0967048DAE8}.Release|Any CPU.Build.0 = Release|Any CPU
{D2253234-1279-486E-8A63-D8C3424E0525}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D2253234-1279-486E-8A63-D8C3424E0525}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D2253234-1279-486E-8A63-D8C3424E0525}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D2253234-1279-486E-8A63-D8C3424E0525}.Release|Any CPU.Build.0 = Release|Any CPU
{A8BA1066-5695-4D71-ABB4-65E5A5E0C3D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A8BA1066-5695-4D71-ABB4-65E5A5E0C3D4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A8BA1066-5695-4D71-ABB4-65E5A5E0C3D4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A8BA1066-5695-4D71-ABB4-65E5A5E0C3D4}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
24 changes: 19 additions & 5 deletions AuthBot/ContextExtensions.cs
Original file line number Diff line number Diff line change
@@ -95,11 +95,25 @@ public static void StoreAuthResult(this IBotContext context, AuthResult authResu

public static async Task Logout(this IBotContext context)
{
context.UserData.RemoveValue(ContextConstants.AuthResultKey);
context.UserData.RemoveValue(ContextConstants.MagicNumberKey);
context.UserData.RemoveValue(ContextConstants.MagicNumberValidated);
string signoutURl = "https://login.microsoftonline.com/common/oauth2/logout?post_logout_redirect_uri=" + System.Net.WebUtility.UrlEncode(AuthSettings.RedirectUrl);
await context.PostAsync($"In order to finish the sign out, please click at this [link]({signoutURl}).");
AuthResult authResult;
string signoutURl;

if (context.UserData.TryGetValue(ContextConstants.AuthResultKey, out authResult))
{
context.UserData.RemoveValue(ContextConstants.AuthResultKey);
context.UserData.RemoveValue(ContextConstants.MagicNumberKey);
context.UserData.RemoveValue(ContextConstants.MagicNumberValidated);
if (string.Equals(authResult.authType, "vso", StringComparison.OrdinalIgnoreCase))
{
signoutURl = "//https://app.vssps.visualstudio.com/_signout";
}
else
{
signoutURl = "https://login.microsoftonline.com/common/oauth2/logout?post_logout_redirect_uri=" + System.Net.WebUtility.UrlEncode(AuthSettings.RedirectUrl);
}

await context.PostAsync($"In order to finish the sign out, please click at this [link]({signoutURl}).");
}
}

}
3 changes: 2 additions & 1 deletion SampleAADv1Bot/Dialogs/ActionDialog.cs
Original file line number Diff line number Diff line change
@@ -39,6 +39,8 @@ public virtual async Task MessageReceivedAsync(IDialogContext context, IAwaitabl

if (message.Text == "logon")
{


//endpoint v1
if (string.IsNullOrEmpty(await context.GetAccessToken(ConfigurationManager.AppSettings["ActiveDirectory.ResourceId"])))
{
@@ -66,7 +68,6 @@ public virtual async Task MessageReceivedAsync(IDialogContext context, IAwaitabl
}
else
{
await context.PostAsync("say what ?");
context.Wait(MessageReceivedAsync);
}
}
13 changes: 4 additions & 9 deletions SampleAADv1Bot/SampleAADv1Bot.csproj
Original file line number Diff line number Diff line change
@@ -45,6 +45,10 @@
<NoWarn>CS1998</NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="AuthBot, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\AuthBot.3.0.2-alpha\lib\net40\AuthBot.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Autofac, Version=4.0.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da, processorArchitecture=MSIL">
<HintPath>..\packages\Autofac.4.0.0-rc3-309\lib\net451\Autofac.dll</HintPath>
<Private>True</Private>
@@ -197,15 +201,6 @@
<DependentUpon>Web.config</DependentUpon>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AuthBot\AuthBot.csproj">
<Project>{b8ad59d3-c36d-4e18-b504-06871001bc8d}</Project>
<Name>AuthBot</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\PublishProfiles\" />
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
39 changes: 10 additions & 29 deletions SampleAADv1Bot/Web.config
Original file line number Diff line number Diff line change
@@ -6,37 +6,18 @@
<configuration>
<appSettings>
<!-- update these with your BotId, Microsoft App Id and your Microsoft App Password-->
<add key="BotId" value="MSGraphBot" />
<add key="MicrosoftAppId" value="35e00d09-ad08-4413-9ea2-3602c3434106" />
<add key="MicrosoftAppPassword" value="UFDEsBUoqkH3gjkmMnTFacY" />
<add key="BotId" value="YourBotId" />
<add key="MicrosoftAppId" value="" />
<add key="MicrosoftAppPassword" value="" />

<!--MSGraphBotTiago123-->
<!-- Microsoft AD -->
<!--<add key="ActiveDirectory.Mode" value="v1" />
<add key="ActiveDirectory.ResourceId" value="https://graph.microsoft.com/" />
<!-- AAD Auth v1 settings -->
<add key="ActiveDirectory.Mode" value="v1" />
<add key="ActiveDirectory.ResourceId" value="https://graph.windows.net/" />
<add key="ActiveDirectory.EndpointUrl" value="https://login.microsoftonline.com" />
<add key="ActiveDirectory.Tenant" value="72f988bf-86f1-41af-91ab-2d7cd011db47" />
<add key="ActiveDirectory.ClientId" value="028149ea-02ed-474c-8472-6fc2df4d8b5b" />
<add key="ActiveDirectory.ClientSecret" value="paU3t/vu2NaiO+gA8dZFqyyUYWe0x0Ps7+B+Wj3X1YY=" />
<add key="ActiveDirectory.RedirectUrl" value="https://localhost:44339/api/OAuthCallback" />-->

<!-- WattSkyt AD -->
<!--<add key="ActiveDirectory.Mode" value="v1" />
<add key="ActiveDirectory.ResourceId" value="https://graph.microsoft.com" />
<add key="ActiveDirectory.EndpointUrl" value="https://login.microsoftonline.com" />
<add key="ActiveDirectory.Tenant" value="db8e431d-8772-4a9c-884c-50fbc65c560d" />
<add key="ActiveDirectory.ClientId" value="d45b70bc-0558-4e6d-a06a-afd440bde94b" />
<add key="ActiveDirectory.ClientSecret" value="BnAe9NcoWQODHPJZuf4R4d3QyiII2yZqUw/ndY/i8Do=" />
<add key="ActiveDirectory.RedirectUrl" value="https://localhost:44308/api/OAuthCallback" />-->

<!-- VSO -->
<add key="ActiveDirectory.Mode" value="vso" />
<add key="ActiveDirectory.ResourceId" value="dpeted" />
<add key="ActiveDirectory.EndpointUrl" value="https://app.vssps.visualstudio.com" />
<add key="ActiveDirectory.Tenant" value="vso.work" />
<add key="ActiveDirectory.ClientId" value="DADB6890-1B01-4C84-BB7B-15FA7F18D716" />
<add key="ActiveDirectory.ClientSecret" value="eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Im9PdmN6NU1fN3AtSGpJS2xGWHo5M3VfVjBabyJ9.eyJjaWQiOiJkYWRiNjg5MC0xYjAxLTRjODQtYmI3Yi0xNWZhN2YxOGQ3MTYiLCJjc2kiOiIxOTk0OGNmYi0wZWEzLTQ0NTYtOGI2Yi0yYzBhOTZmZGFlMzIiLCJuYW1laWQiOiI2ZWE2NDE1NS1jMmRmLTRkODctOTY2YS0wZTE5ZDY3ZGM2YjgiLCJpc3MiOiJhcHAudnNzcHMudmlzdWFsc3R1ZGlvLmNvbSIsImF1ZCI6ImFwcC52c3Nwcy52aXN1YWxzdHVkaW8uY29tIiwibmJmIjoxNDY4OTIzMzQ0LCJleHAiOjE2MjY2ODk3NDR9.QJII_OsG7IZF3ObwUPmm8cvJOmJefvGJCJQTuYHV-H93ZejLxtkXNsRibp8Fasnqbxt3eXQAoW6aT8Xe3-b46fq8xYZGV87iNpXQ-sln2swQ0F-u-rzU5cbT9eAsT_DfOIRFIZYXRX4TZ6MVNcq5_4qQ0g7YBhLec5DAejW8NSgSpJehJ5Nh-N21K2vJdClbEJRlgXyx3nhK-y-3VSRZsP6sK5lf9Ko9wm7vWd6mY4htp2CULLk3JhuHMPRvH6D6zGsWyWxPY_RlUCwV7_pHaHX01ycLHTMgHVx8tW6c8Dpv9UrS7dixdOH2NM_0N6BJI2MavOtzTXoDfN3f_O0xKA" />
<add key="ActiveDirectory.RedirectUrl" value="https://tiagonmasbot.azurewebsites.net/api/OAuthCallback" />
<add key="ActiveDirectory.Tenant" value="dxdemos.net" />
<add key="ActiveDirectory.ClientId" value="2d3b5788-05a5-486d-b2a4-2772a4511396" />
<add key="ActiveDirectory.ClientSecret" value="wU3oFBJ1gjWcB8Lo/fMaaCwg7ygg8Y9zBJlUq+0yBN0=" />
<add key="ActiveDirectory.RedirectUrl" value="http://localhost:3978/api/OAuthCallback" />


</appSettings>
4 changes: 3 additions & 1 deletion SampleAADv1Bot/default.htm
Original file line number Diff line number Diff line change
@@ -5,7 +5,9 @@
<meta charset="utf-8" />
</head>
<body style="font-family:'Segoe UI'">
<h1>Sample AAD v1 Bot (Tiagoand v1)</h1>
<h1>Sample AAD v1 Bot</h1>


</body>

</html>
27 changes: 27 additions & 0 deletions SampleVSOBot/App_Start/WebApiConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Http;

namespace SampleVSOBot
{
public static class WebApiConfig
{
public static void Register(HttpConfiguration config)
{
// Web API configuration and services

// Web API routes
config.MapHttpAttributeRoutes();

config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
}

}
}
83 changes: 83 additions & 0 deletions SampleVSOBot/Controllers/MessagesController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
// Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file.
namespace SampleVSOBot
{
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Web.Http;
using Dialogs;
using Microsoft.Bot.Builder.Dialogs;
using Microsoft.Bot.Builder.FormFlow;
using Microsoft.Bot.Connector;
using System.Web.Http.Description;
using System.Net.Http;

[BotAuthentication]
public class MessagesController : ApiController
{
/// <summary>
/// POST: api/Messages
/// Receive a message from a user and reply to it
/// </summary>
[BotAuthentication]

public virtual async Task<HttpResponseMessage> Post([FromBody]Activity activity)
{
if (activity != null && activity.GetActivityType() == ActivityTypes.Message)
{
await Conversation.SendAsync(activity, () => new ActionDialog());
}
else
{
this.HandleSystemMessage(activity);
}
return new HttpResponseMessage(System.Net.HttpStatusCode.Accepted);
}

private Activity HandleSystemMessage(Activity message)
{
if (message.Type == ActivityTypes.Ping)
{
Activity reply = message.CreateReply();
reply.Type = ActivityTypes.Ping;
return reply;
}

return null;
}
}
}
//*********************************************************
//
//AuthBot, https://github.com/matvelloso/AuthBot
//
//Copyright (c) Microsoft Corporation
//All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// ""Software""), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:




// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.




// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//*********************************************************
118 changes: 118 additions & 0 deletions SampleVSOBot/Dialogs/ActionDialog.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
// Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file.
namespace SampleVSOBot.Dialogs
{
using System;
using System.Threading;
using System.Threading.Tasks;
using AuthBot;
using AuthBot.Dialogs;
using AuthBot.Models;
using Microsoft.Bot.Builder.Dialogs;
using Microsoft.Bot.Connector;
using System.Configuration;
[Serializable]
public class ActionDialog : IDialog<string>
{
public async Task StartAsync(IDialogContext context)
{
context.Wait(MessageReceivedAsync);
}

public async Task TokenSample(IDialogContext context)
{
//endpoint v1
var accessToken = await context.GetAccessToken(ConfigurationManager.AppSettings["ActiveDirectory.ResourceId"]);

if (string.IsNullOrEmpty(accessToken))
{
return;
}

await context.PostAsync($"Your access token is: {accessToken}");

context.Wait(MessageReceivedAsync);
}

public virtual async Task MessageReceivedAsync(IDialogContext context, IAwaitable<IMessageActivity> item)
{
var message = await item;

if (message.Text == "logon")
{
//endpoint v1
if (string.IsNullOrEmpty(await context.GetAccessToken(ConfigurationManager.AppSettings["ActiveDirectory.ResourceId"])))
{
await context.Forward(new AzureAuthDialog(ConfigurationManager.AppSettings["ActiveDirectory.ResourceId"]), this.ResumeAfterAuth, message, CancellationToken.None);
}
else
{
context.Wait(MessageReceivedAsync);
}
}
else if (message.Text == "echo")
{
await context.PostAsync("echo");

context.Wait(this.MessageReceivedAsync);
}
else if (message.Text == "token")
{
await TokenSample(context);
}
else if (message.Text == "logout")
{
await context.Logout();
context.Wait(this.MessageReceivedAsync);
}
else
{
await context.PostAsync("say what ?");
context.Wait(MessageReceivedAsync);
}
}

private async Task ResumeAfterAuth(IDialogContext context, IAwaitable<string> result)
{
var message = await result;

await context.PostAsync(message);
context.Wait(MessageReceivedAsync);
}
}
}


//*********************************************************
//
//AuthBot, https://github.com/matvelloso/AuthBot
//
//Copyright (c) Microsoft Corporation
//All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// ""Software""), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:




// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.




// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//*********************************************************
91 changes: 91 additions & 0 deletions SampleVSOBot/Dialogs/DialogExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
// Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file.
namespace SampleVSOBot.Dialogs
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Autofac;
using Microsoft.Bot.Builder.Dialogs;
using Microsoft.Bot.Builder.Dialogs.Internals;
using Microsoft.Bot.Builder.Luis.Models;
using Microsoft.Bot.Connector;

public static class DialogExtensions
{
public static void NotifyLongRunningOperation<T>(this Task<T> operation, IDialogContext context, Func<T, string> handler)
{
operation.ContinueWith(
async (t, ctx) =>
{
var messageText = handler(t.Result);
await NotifyUser((IDialogContext)ctx, messageText);
},
context);
}

public static void NotifyLongRunningOperation<T>(this Task<T> operation, IDialogContext context, Func<T, IDialogContext, string> handler)
{
operation.ContinueWith(
async (t, ctx) =>
{
var messageText = handler(t.Result, (IDialogContext)ctx);
await NotifyUser((IDialogContext)ctx, messageText);
},
context);
}

public static string GetEntityOriginalText(this EntityRecommendation recommendation, string query)
{
if (recommendation.StartIndex.HasValue && recommendation.EndIndex.HasValue)
{
return query.Substring(recommendation.StartIndex.Value, recommendation.EndIndex.Value - recommendation.StartIndex.Value + 1);
}

return null;
}

public static async Task NotifyUser(this IDialogContext context, string messageText)
{
if (!string.IsNullOrEmpty(messageText))
{
await context.PostAsync(messageText);
}
}
}
}

//*********************************************************
//
//AuthBot, https://github.com/matvelloso/AuthBot
//
//Copyright (c) Microsoft Corporation
//All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// ""Software""), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:




// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.




// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//*********************************************************
1 change: 1 addition & 0 deletions SampleVSOBot/Global.asax
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<%@ Application Codebehind="Global.asax.cs" Inherits="SampleVSOBot.WebApiApplication" Language="C#" %>
24 changes: 24 additions & 0 deletions SampleVSOBot/Global.asax.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Routing;

namespace SampleVSOBot
{
public class WebApiApplication : System.Web.HttpApplication
{
protected void Application_Start()
{
GlobalConfiguration.Configure(WebApiConfig.Register);
AuthBot.Models.AuthSettings.Mode = ConfigurationManager.AppSettings["ActiveDirectory.Mode"];
AuthBot.Models.AuthSettings.EndpointUrl = ConfigurationManager.AppSettings["ActiveDirectory.EndpointUrl"];
AuthBot.Models.AuthSettings.Tenant = ConfigurationManager.AppSettings["ActiveDirectory.Tenant"];
AuthBot.Models.AuthSettings.RedirectUrl = ConfigurationManager.AppSettings["ActiveDirectory.RedirectUrl"];
AuthBot.Models.AuthSettings.ClientId = ConfigurationManager.AppSettings["ActiveDirectory.ClientId"];
AuthBot.Models.AuthSettings.ClientSecret = ConfigurationManager.AppSettings["ActiveDirectory.ClientSecret"];
}
}
}
35 changes: 35 additions & 0 deletions SampleVSOBot/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("SampleVSOBot")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SampleVSOBot")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("a8ba1066-5695-4d71-abb4-65e5a5e0c3d4")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
183 changes: 183 additions & 0 deletions SampleVSOBot/SampleVSOBot.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>
</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{A8BA1066-5695-4D71-ABB4-65E5A5E0C3D4}</ProjectGuid>
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SampleVSOBot</RootNamespace>
<AssemblyName>Bot Application1</AssemblyName>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<UseIISExpress>true</UseIISExpress>
<IISExpressSSLPort>44370</IISExpressSSLPort>
<IISExpressAnonymousAuthentication />
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
<UseGlobalApplicationHostFile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Autofac, Version=3.5.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da, processorArchitecture=MSIL">
<HintPath>..\packages\Autofac.3.5.2\lib\net40\Autofac.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Chronic, Version=0.3.2.0, Culture=neutral, PublicKeyToken=3bd1f1ef638b0d3c, processorArchitecture=MSIL">
<HintPath>..\packages\Chronic.Signed.0.3.2\lib\net40\Chronic.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Bot.Builder, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bot.Builder.3.0.1\lib\net46\Microsoft.Bot.Builder.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Bot.Connector, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bot.Builder.3.0.1\lib\net46\Microsoft.Bot.Connector.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.IdentityModel.Protocol.Extensions, Version=1.0.2.33, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.IdentityModel.Protocol.Extensions.1.0.2.206221351\lib\net45\Microsoft.IdentityModel.Protocol.Extensions.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Rest.ClientRuntime, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Rest.ClientRuntime.1.8.2\lib\net45\Microsoft.Rest.ClientRuntime.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Configuration, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.WindowsAzure.ConfigurationManager.3.2.1\lib\net40\Microsoft.WindowsAzure.Configuration.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.IdentityModel.Tokens.Jwt, Version=4.0.20622.1351, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\System.IdentityModel.Tokens.Jwt.4.0.2.206221351\lib\net45\System.IdentityModel.Tokens.Jwt.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Net" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Net.Http.Formatting, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Net.Http.WebRequest" />
<Reference Include="System.Web.DynamicData" />
<Reference Include="System.Web.Entity" />
<Reference Include="System.Web.ApplicationServices" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Drawing" />
<Reference Include="System.Web" />
<Reference Include="System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Web.Http.WebHost, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.WebHost.5.2.3\lib\net45\System.Web.Http.WebHost.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Xml" />
<Reference Include="System.Configuration" />
<Reference Include="System.Web.Services" />
<Reference Include="System.EnterpriseServices" />
<Reference Include="System.Xml.Linq" />
</ItemGroup>
<ItemGroup>
<Content Include="default.htm" />
<Content Include="Global.asax" />
<Content Include="Web.config">
<SubType>Designer</SubType>
</Content>
</ItemGroup>
<ItemGroup>
<Compile Include="App_Start\WebApiConfig.cs" />
<Compile Include="Controllers\MessagesController.cs" />
<Compile Include="Dialogs\ActionDialog.cs" />
<Compile Include="Dialogs\DialogExtensions.cs" />
<Compile Include="Global.asax.cs">
<DependentUpon>Global.asax</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="packages.config" />
<None Include="Properties\PublishProfiles\TiagonmasBot - Web Deploy.pubxml" />
<None Include="Web.Debug.config">
<DependentUpon>Web.config</DependentUpon>
</None>
<None Include="Web.Release.config">
<DependentUpon>Web.config</DependentUpon>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AuthBot\AuthBot.csproj">
<Project>{b8ad59d3-c36d-4e18-b504-06871001bc8d}</Project>
<Name>AuthBot</Name>
</ProjectReference>
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<PropertyGroup>
<EnableMSDeployAppOffline>true</EnableMSDeployAppOffline>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<UseIIS>True</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>3979</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>https://localhost:44370/</IISUrl>
<OverrideIISAppRootUrl>True</OverrideIISAppRootUrl>
<IISAppRootUrl>https://localhost:44370/</IISAppRootUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>
</CustomServerUrl>
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties>
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
30 changes: 30 additions & 0 deletions SampleVSOBot/Web.Debug.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>

<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->

<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<!--
In the example below, the "SetAttributes" transform will change the value of
"connectionString" to use "ReleaseSQLServer" only when the "Match" locator
finds an attribute "name" that has a value of "MyDB".
<connectionStrings>
<add name="MyDB"
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</connectionStrings>
-->
<system.web>
<!--
In the example below, the "Replace" transform will replace the entire
<customErrors> section of your web.config file.
Note that because there is only one customErrors section under the
<system.web> node, there is no need to use the "xdt:Locator" attribute.
<customErrors defaultRedirect="GenericError.htm"
mode="RemoteOnly" xdt:Transform="Replace">
<error statusCode="500" redirect="InternalError.htm"/>
</customErrors>
-->
</system.web>
</configuration>
31 changes: 31 additions & 0 deletions SampleVSOBot/Web.Release.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>

<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->

<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<!--
In the example below, the "SetAttributes" transform will change the value of
"connectionString" to use "ReleaseSQLServer" only when the "Match" locator
finds an attribute "name" that has a value of "MyDB".
<connectionStrings>
<add name="MyDB"
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</connectionStrings>
-->
<system.web>
<compilation xdt:Transform="RemoveAttributes(debug)" />
<!--
In the example below, the "Replace" transform will replace the entire
<customErrors> section of your web.config file.
Note that because there is only one customErrors section under the
<system.web> node, there is no need to use the "xdt:Locator" attribute.
<customErrors defaultRedirect="GenericError.htm"
mode="RemoteOnly" xdt:Transform="Replace">
<error statusCode="500" redirect="InternalError.htm"/>
</customErrors>
-->
</system.web>
</configuration>
100 changes: 100 additions & 0 deletions SampleVSOBot/Web.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=301879
-->
<configuration>
<appSettings>
<!-- update these with your BotId, Microsoft App Id and your Microsoft App Password-->
<add key="BotId" value="MSGraphBot" />
<add key="MicrosoftAppId" value="35e00d09-ad08-4413-9ea2-3602c3434106" />
<add key="MicrosoftAppPassword" value="UFDEsBUoqkH3gjkmMnTFacY" />

<!--MSGraphBotTiago123-->
<!-- Microsoft AD -->
<!--<add key="ActiveDirectory.Mode" value="v1" />
<add key="ActiveDirectory.ResourceId" value="https://graph.microsoft.com/" />
<add key="ActiveDirectory.EndpointUrl" value="https://login.microsoftonline.com" />
<add key="ActiveDirectory.Tenant" value="72f988bf-86f1-41af-91ab-2d7cd011db47" />
<add key="ActiveDirectory.ClientId" value="028149ea-02ed-474c-8472-6fc2df4d8b5b" />
<add key="ActiveDirectory.ClientSecret" value="paU3t/vu2NaiO+gA8dZFqyyUYWe0x0Ps7+B+Wj3X1YY=" />
<add key="ActiveDirectory.RedirectUrl" value="https://localhost:44339/api/OAuthCallback" />-->

<!-- WattSkyt AD -->
<!--<add key="ActiveDirectory.Mode" value="v1" />
<add key="ActiveDirectory.ResourceId" value="https://graph.microsoft.com" />
<add key="ActiveDirectory.EndpointUrl" value="https://login.microsoftonline.com" />
<add key="ActiveDirectory.Tenant" value="db8e431d-8772-4a9c-884c-50fbc65c560d" />
<add key="ActiveDirectory.ClientId" value="d45b70bc-0558-4e6d-a06a-afd440bde94b" />
<add key="ActiveDirectory.ClientSecret" value="BnAe9NcoWQODHPJZuf4R4d3QyiII2yZqUw/ndY/i8Do=" />
<add key="ActiveDirectory.RedirectUrl" value="https://localhost:44308/api/OAuthCallback" />-->

<!-- VSO -->
<add key="ActiveDirectory.Mode" value="vso" />
<add key="ActiveDirectory.ResourceId" value="dpeted" />
<add key="ActiveDirectory.EndpointUrl" value="https://app.vssps.visualstudio.com" />
<add key="ActiveDirectory.Tenant" value="vso.work" />
<add key="ActiveDirectory.ClientId" value="DADB6890-1B01-4C84-BB7B-15FA7F18D716" />
<add key="ActiveDirectory.ClientSecret" value="eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Im9PdmN6NU1fN3AtSGpJS2xGWHo5M3VfVjBabyJ9.eyJjaWQiOiJkYWRiNjg5MC0xYjAxLTRjODQtYmI3Yi0xNWZhN2YxOGQ3MTYiLCJjc2kiOiIxOTk0OGNmYi0wZWEzLTQ0NTYtOGI2Yi0yYzBhOTZmZGFlMzIiLCJuYW1laWQiOiI2ZWE2NDE1NS1jMmRmLTRkODctOTY2YS0wZTE5ZDY3ZGM2YjgiLCJpc3MiOiJhcHAudnNzcHMudmlzdWFsc3R1ZGlvLmNvbSIsImF1ZCI6ImFwcC52c3Nwcy52aXN1YWxzdHVkaW8uY29tIiwibmJmIjoxNDY4OTIzMzQ0LCJleHAiOjE2MjY2ODk3NDR9.QJII_OsG7IZF3ObwUPmm8cvJOmJefvGJCJQTuYHV-H93ZejLxtkXNsRibp8Fasnqbxt3eXQAoW6aT8Xe3-b46fq8xYZGV87iNpXQ-sln2swQ0F-u-rzU5cbT9eAsT_DfOIRFIZYXRX4TZ6MVNcq5_4qQ0g7YBhLec5DAejW8NSgSpJehJ5Nh-N21K2vJdClbEJRlgXyx3nhK-y-3VSRZsP6sK5lf9Ko9wm7vWd6mY4htp2CULLk3JhuHMPRvH6D6zGsWyWxPY_RlUCwV7_pHaHX01ycLHTMgHVx8tW6c8Dpv9UrS7dixdOH2NM_0N6BJI2MavOtzTXoDfN3f_O0xKA" />
<add key="ActiveDirectory.RedirectUrl" value="https://tiagonmasbot.azurewebsites.net/api/OAuthCallback" />
</appSettings>
<!--
For a description of web.config changes see http://go.microsoft.com/fwlink/?LinkId=235367.
The following attributes can be set on the <httpRuntime> tag.
<system.Web>
<httpRuntime targetFramework="4.6" />
</system.Web>
-->
<system.web>
<customErrors mode="Off" />
<compilation debug="true" targetFramework="4.6" />
<httpRuntime targetFramework="4.6" />
</system.web>
<system.webServer>
<defaultDocument>
<files>
<clear />
<add value="default.htm" />
</files>
</defaultDocument>

<handlers>
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<remove name="OPTIONSVerbHandler" />
<remove name="TRACEVerbHandler" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers></system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.29.0" newVersion="4.2.29.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.Serialization.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.1.1.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
10 changes: 10 additions & 0 deletions SampleVSOBot/default.htm
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8" />
</head>
<body style="font-family:'Segoe UI'">
<h1>Sample VSO Bot </h1>
</body>
</html>
15 changes: 15 additions & 0 deletions SampleVSOBot/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Autofac" version="3.5.2" targetFramework="net46" />
<package id="Chronic.Signed" version="0.3.2" targetFramework="net46" />
<package id="Microsoft.AspNet.WebApi" version="5.2.3" targetFramework="net46" />
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net46" />
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.3" targetFramework="net46" />
<package id="Microsoft.AspNet.WebApi.WebHost" version="5.2.3" targetFramework="net46" />
<package id="Microsoft.Bot.Builder" version="3.0.1" targetFramework="net46" />
<package id="Microsoft.IdentityModel.Protocol.Extensions" version="1.0.2.206221351" targetFramework="net46" />
<package id="Microsoft.Rest.ClientRuntime" version="1.8.2" targetFramework="net46" />
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="3.2.1" targetFramework="net46" />
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="net46" />
<package id="System.IdentityModel.Tokens.Jwt" version="4.0.2.206221351" targetFramework="net46" />
</packages>