Azure
Microsoft Bot Framework: Contextual authentication with the webchat control in SharePointBy Rick Van Rousselt
23 March 2017
This post was stuck in my drafts folder for some time. I was doubting to post it because Richard diZerega has found a way better way to do the same thing. But I thought why not post it. There are always lots of ways to get the same result in development. I find his way better actually because I think my approach would have security issues.
Context
A while ago I read a blog post from Stéphane Eyskens who is a Microsoft MVP about authenticating a bot with ADAL so that you could call the Microsoft Graph with the token of the user in your bot. This then could be leveraged to get for instance the information or, as he uses in his blog, get the profile picture of the user talking to the bot. There is already a GitHub project for authenticating with the bot framework called the AuthBot but this includes a pop-up and copy pasting of code. As Stéphane also points out, in an enterprise context this is not something the end users are waiting for. They have to login enough into multiple systems on a regular working day. Now while playing around with the Bot framework and the webchat control I found out that the webchat control is actually open sourced. They made the code available on GitHub. So looking at this I noticed that, while Stéphane proposes a solution that incorporates a proxy, I found an alternative way of doing this. This way is more focused on incorporating the webchat into SharePoint Online and have contextual authentication.
Read Microsoft Bot Framework: …