BotFramework-Emulator icon indicating copy to clipboard operation
BotFramework-Emulator copied to clipboard

APP ID/Passwords shared between tabs cause conversation to fail

Open p-nagpal opened this issue 6 years ago • 2 comments

Github issues should be used for bugs and feature requests. Use Stack Overflow for general "how-to" questions.

Version

3.3

Describe the bug

The emulator seems to cache the AppId and password used to connect to a bot between tabs/conversations. If a bot is updated to remove / add the appsettings.json then the emulator needs to be restarted to pick up the change. Starting a new conversation tab or restarting the conversation fails as it uses the previous state. (Restarting the emulator is not the obvious choice when one encounters a exception in the bot)

To Reproduce

Steps to reproduce the behavior:

  1. Start a conversation with a bot running locally and using appsettings.json (and a valid appID and password specified in it). This conversation works fine.
  2. Stop the bot application, Delete the appsettings.json and restart the bot.
  3. The bot should now allow conversations where App ID and password are not specified.
  4. Do not close the emulator. "Open the bot" again and this time, only specify the endpoint and not App Id and Password.
  5. The new conversation will fail with an error and the bot debug window shows that the older App Id and password is still being passed in:

fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1]
System.UnauthorizedAccessException: Invalid AppId passed on token: <APP ID> at Microsoft.Bot.Connector.Authentication.EmulatorValidation.AuthenticateEmulatorToken(String authHeader, ICredentialProvider credentials, IChannelProvider channelProvider, HttpClient httpClient, String channelId) ...

Expected behavior

If the emulator needs to be restarted to pick up new bot settings, then this should be made more obvious to users.

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.

[bug]

p-nagpal avatar Mar 21 '19 22:03 p-nagpal

FWIW, we had several people run into this during our latest OpenHack in Los Angeles as well.

drub0y avatar Apr 08 '19 22:04 drub0y

@cwhitten I'd still like to investigate this one as I believe I ran into this scenario on 4.5.x.

@drub0y do you recall if the people who ran into this were using 3.3 of the emulator or a 4.x version?

stevengum avatar Jul 29 '19 18:07 stevengum