Error in web chat "Authorization for Microsoft App ID failed with status code Forbidden"
I have integrated my bot with Facebook, skype & web chat. Fb & Skype are working fine. But I am getting forbidden exception for web chat. It is not sending the replies. I have updated the framework to 3.1.0 as well.
Thanks in advance.
Are you using the Direct Line secret in your web chat url ?
Yes...I'm using key mentioned in the embedded code.
can you tell me your bot id?
msboombot
Hi,
I'm still getting the same error. Any update on this issue.
Hello, thanks for your patience. I can see the issue occurring. Are you using C# or Node.js ?
I am facing this same issue while trying to update my bot, it fails on skype and telegram, haven't tested other channels. My bot is in C#
Hi @manojkota - can you share a code sample of your dialog structure and how you are sending messages?
I'm generating random messages based on internal process. But my basic implementation is this.
var reply = await connector.Conversations.SendToConversationAsync(item);
I'm having the same issues :( BotID "eldur3"
Thanks @manojkota and @liiver - at this point it would be very helpful for us to diagnose your issue if you can provide a more complete code sample which reproduces the issue. We cannot reproduce the scenario so if you can isolate a code block that will be valuable for us.
For me it seems similas as with @manojkota
So debugging it also locally, the exeption is either thrown in await connector.Conversations.ReplyToActivityAsync(reply); or await Conversation.SendAsync(activity, () => new MainDialog()); i.e. it It does not seem to go onwards from there to my MainDialog() which is a LuisDialog
But in the first example, there is no LuisDIalog involved, but the same error. Seem bug-ish to me. Using BotBuilder 3.2.0
Code example:
if (activity.Type == ActivityTypes.Message) { await Conversation.SendAsync(activity, () => new MainDialog()); } else if (activity.Type == ActivityTypes.ConversationUpdate) { ConnectorClient connector = new ConnectorClient(new Uri(activity.ServiceUrl)); Activity reply = activity.CreateReply(activity.From.Name); await connector.Conversations.ReplyToActivityAsync(reply); }
any updates on this one? Seems to be some bug then or?
@manojkota and @liiver it would be good if you can share the code that repros this. Creating a repo with the code that have a repro for this issue will help us diagnose this issue.
Mine is a private repository. I can't provide access to it.
@manojkota would be good if you can create a project that has the minimal code to repro this issue.
@msft-shahins, somehow the issue is resolved on its own. Thank you for your help.
I have the same issue. I have a well working bot that replies to messages in Slack and Skype. for my Slack users the bot also sends scheduled message every morning. I have a very simple code that once worked and than it started giving the "Authorization for Microsoft App ID ... failed with status code Forbidden" error .
Using latest bot framework NuGet Microsoft.Bot.Builder 3.5. I triple checked I have my MicrosoftAppId and MicrosoftAppPassword in the app config file, also tried to specify explicitly in the code below. Same error.
Here is the test code that I thought should work:
private void button1_Click(object sender, EventArgs e) { var connector = new ConnectorClient(new Uri("https://slack.botframework.com"), ".. my app id removed here...", "...removed password..."); var conversation = new ConversationAccount(true, "B0GRPT96X:T04EVT5HU:C0L57SCKY"); var botAccount = new ChannelAccount("B0GRPT96X:T04EVT5HU", "grasp"); IMessageActivity message = Activity.CreateMessageActivity(); message.From = botAccount; message.Conversation = conversation; message.ChannelId = "slack"; message.Text = "some text"; message.Locale = "en-En"; connector.Conversations.SendToConversation((Activity)message); }
If I call
bool t = MicrosoftAppCredentials.IsTrustedServiceUrl("https://slack.botframework.com");
it returns false.
Thanks for your help.
@danmarshall , @msft-shahins - I just noticed this issue was closed. Can you provide any guidance on the error I still get? Or should I open a new issue. thanks