-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to authorise with bot even though credentials are apparently valid #2237
Comments
Can you paste any error stack trace from the webchat (in your browser's debug console) or from your server? |
Hi Dan, The stack trace in the failed request trace file from the server is below:
This is the code preceding and including line 74 of MessageController.cs - line 43 is the call into the HandleSystemMessage method. It is used to send a greeting message to the user when they begin a conversation. Line 74 is the ReplyToActivityAsync call:
Configuring a web chat client with the necessary token to interact with the chat bot doesn't produce any results, not even debugging output when chatbotDebug is set to true. However looking at the network tab on Chrome's debugger shows that it does appear to authenticate successfully, as this response is received from the direct line service after loading the web chat:
Let me know if there is anything else I can provide which could help. Thanks a lot. |
@weedroid can you provide the MicrosoftAppId for your bot? |
Hi @msft-shahins, The MicrosoftAppId for my bot is bc0e84e1-29d0-4412-ba19-c3f7f74dffec |
I'm now encountering the same issue with a bot hosted outwith Azure, whose framework I have upgraded from v3.5.2 to v3.5.3. After deploying the version with the upgraded framework, the bot fails with the "authorisation failed" exception in my first post. Restoring the previous version with framework v3.5.2 makes the bot work again. There have been no other substantial changes. Generating and using a new password has no effect. |
I am having the same issue. It seems that the credentials are being ignored when used in the web.config. With a simple solution (e.g. sandwichbot), if I have the credentials in the web.config and run it through the emulator (without credentials) it gives me an expected error of "Bot's MSA appid or password is incorrect". With the solution I am working on it does not do this, and instead starts the conversation even though the web.config has credentials and the emulator doesn't. If I put credentials into the emulator it does connect, but then gives 500 errors on any user input. There is code in the global.asax file which is similar to the AlarmBot sample, which has this
If this code is removed, the correct authorisation behaviour is seen (but subsequently breaks because dialog registration has not happened). Also noticed while this is a similar setup to the AlarmBot sample, the sample doesn't have credentials in the web.config like the other samples do. Is this a coincidence or is there another means of authenticating the bot? Thanks. |
I'm seeing the same issue. On version 3.5.3 |
@weedroid Are you still experiencing the issue after upgrading to BotBuilder 3.8.1? |
I'm using project type of ASP .Net Core 2.0 with target framework net461 and I get the same error that @weedroid mentioned above. Is there any solution to this? |
I have deployed a chat bot to an Azure instance, but have been unable to test it using either the emulator or the web chat built into the backend of the bots site. I have configured it with the ID and password generated by the bots site, but the problem still occurs.
Failed request tracing on the Azure instance indicates that requests are causing an "Authorization for Microsoft App ID (guid) failed with status code Unauthorized" error.
I have went through the authentication troubleshooting steps on this page and have found the following:
The bot's endpoint has been set up correctly - it points to the address of the Azure instance it is deployed to, uses https, and includes /api/messages at the end. The "test" feature on the bot's configuration page also returns a "Endpoint authorization succeeded" message.
The text was updated successfully, but these errors were encountered: