Megan
Megan

Reputation: 1150

NuGet Package for IBotContext.GetAccessToken()?

I am trying to create an Authentication service for my bot I built using the Bot Framework. At one point in my code I try to do the following:

 public async Task defaultMessage(IDialogContext context, LuisResult result)
 {
     var token = await context.GetAccessToken();

     // Other code...

 }

but a reference for the method GetAccessToken() can't be found? I am going by the AuthBot example. I think I missed installing a Nuget package? But I haven't been able to find out which one I need from searching online. Thanks for the help.

Upvotes: 1

Views: 115

Answers (1)

Ezequiel Jadib
Ezequiel Jadib

Reputation: 14787

In order to have that extension method available, you have to install the AuthBot Nuget package to your solution and add the following using to your the class where you want to use it:

using AuthBot

The extension method is defined in ContextExtensions class.

Upvotes: 2

Related Questions