-
Notifications
You must be signed in to change notification settings - Fork 54
Unexpected behavior after implementing TableBotDataStore #28
Comments
Same issue. Did you figure out how to get past this problem? |
If someone has the answer to this please post. Thanks! |
Afraid not.. I'm still experiencing the problem. |
@weretygr @yellowwidget @shrubby This is due to the fact that the current implementation of AuthBot is using the default state client in the OAuthCallbackController. Modifying the controller as follows will make it work with the TableBotDataStore implementation you are using:
public class AddressKey : IAddress
{
public string BotId { get; set; }
public string ChannelId { get; set; }
public string ConversationId { get; set; }
public string ServiceUrl { get; set; }
public string UserId { get; set; }
}
var botDataStore = scope.Resolve<IBotDataStore<BotData>>();`
var userData = await botDataStore.LoadAsync(key, BotStoreType.BotUserData, CancellationToken.None);
await botDataStore.SaveAsync(key, BotStoreType.BotUserData, userData, CancellationToken.None);
await botDataStore.FlushAsync(key, CancellationToken.None); I've created a PR for this: #37 |
@EricDahlvang - Thank you very much for your time investigating and figuring this out. I just tested and it works great. |
How do we fix this as we are using the AuthBot Nuget |
@vibjain Please switch your project to using BotAuth. AuthBot uses the default state client, and will be deprecated in the future. https://www.nuget.org/packages/BotAuth/3.9.0-alpha |
Can you provide some guidance on moving to the BotAuth, currently I am stuggling with the ContextExtensions methods like Logout & GetAccessToken will we have to implements these methods ourselves now? I don't see them in the BothAuth anywhere. Thanks |
There is a little information on this page: https://github.com/richdizz/BotAuth/tree/7138ecf743423bcf13f53c09644ecdb60f0ec7da/CSharp and five sample applications. Have you reviewed those? |
Hi @EricDahlvang, thanks for your help. I think I made progress and changed my code form AuthBot to BotAuth. However after completing all the steps I am hitting this open issue. |
@vibjain I've created a PR to address this: https://github.com/richdizz/BotAuth/pull/10 Until it is merged, you can clone the repository, modify the local CallbackController.cs and include it in your project. I hope this helps. |
Install Azure Storage Emulator and check operation
Steps to reproduce using SampleAADv2Bot:
in Global.asax.cs
Add the following after the Application Start method
private void ConfigureBotTableStorage()
{
string tableName = "UserStateDev";
Before the line
GlobalConfiguration.Configure(WebApiConfig.Register);
insert the line
ConfigureBotTableStorage();
Save and compile
Connect to the bot on http://localhost:3978/api/messages with the Bot Framework Channel Emulator
Send logon to the bot inthe emulator
Click the Authentication Required link in the emulator
Log in using a Microsoft account in the browser window that opens
Copy the magic number to send back to the bot
Expected behavior
Bot prompts for the magic number
Actual behavior
Bot displays sign-in card again.
The text was updated successfully, but these errors were encountered: