- How to register app in SharePoint
- How to access SharePoint data in Chat bot
Prerequisite
- To create LUIS app - refer this article.
- To be ready with bot framework dev environment - refer to this article.
- SharePoint environment with Apps configurations.
- Install and configure MongoDB (I am using MongoDB to store tokens but you can use any db)
Initial Setup
Setup 1 Create Web app for authentication
Add new project with ASP.NET Web Application template in your bot application solution and select MVC option.

Make this web application "SSL Enabled" so that the site can be used to register an app to SharePoint.

- public ActionResult LoginWithSharePoint(string userName) {...}
- public ActionResult LoggedinToSharePoint() {...}
- <!DOCTYPE html>
- <html>
- <head><meta name="viewport" content="width=device-width" /><title>SharePoint Login</title></head>
- <body><div>You are logged in with SharePoint successfully.<br>Go back and enjoy chatting!</div></body>
- </html>
As we are going to access SharePoint data in our application as an app, we need to register our app to SharePoint environment and get Client Id and Client Secret.

After registration, we need to grant permissions required for app on SharePoint environment. To grant permission, go to <<sharepoint_site_url>>/_layouts/appinv.aspx.
- <AppPermissionRequests AllowAppOnlyPolicy="true">
- <AppPermissionRequest Scope="http://sharepoint/content/sitecollection" Right="FullControl" />
- </AppPermissionRequests>

App registration is completed. You can view registered apps under <<sharepoint_site_url>>/_layouts/appprincipals.aspx?Scope=Web.
We are ready with Initial setup. Now, we will start with actual implementation, which I will describe in the next article.
- Getting Started With QnA Maker Service
- Quick start - Development Of Chat Bot Using Microsoft Bot Framework - For Beginners
- FAQs Answering bot using Bot Framework and QnA Maker service
- Chat Bot Using Microsoft Bot Framework With LUIS - Part One
- Chat Bot Using Microsoft Bot Framework With LUIS - Part Two
- Chat Bot With Azure Authentication - Part One
- Chat Bot With Azure Authentication - Part Two
- Chat Bot with SharePoint authentication - Part One
- Chat Bot with SharePoint authentication - Part Two
- Develop ChatBot On NodeJS platform Using Microsoft Bot Framework (Part One) - Quick Start For Beginners
- Develop ChatBot On NodeJS Platform Using Microsoft Bot Framework (Part Two) - Manage Conversation Using Root Dialog
- Develop Chatbot On NodeJS Platform Using Microsoft Bot Framework (Part Three) - Manage Conversation Using Multiple Dialogs

Gaurav KSPosted Jan 9, 2020, 9:38 AM
Hi, Answerdialog AzureDialog files are missing from the project
Jobin JosephPosted Jul 15, 2018, 4:23 AM
Could you please tell me where we can get this namespace using Microsoft.SharePoint.Client.EventReceivers;