POST refresh access token failed with status code: 400
Thanks for creating the framework! I am trying to follow this and create the generic bot, but am having issues trying to get the emulator recognize my bot. I have attached the webconfig and error message shown by the emulator.
Hi @khakiali, Sorry you're having this problem. Please check your computer's date and time settings. Our authentication scheme requires these to be accurate to within five minutes.
Hi Eric,
Thanks for the reply. However i do not think that is the root cause.
My date/time is aligned with the authentication. please see attached.
apologies did not mean to close issue :).
its ok - i managed to resolve it. I was using an older version of the template, this conflicted with the new version of the bot!
Hi can you please shed some light on what you meant by older version of the template?
Hi, I was using an earlier version of the SDK which had an older version of the web.config file. The appears to have authentication between that and the emulator. A good way to tell whether you have an older version is that the new version has MicrosoftAppID and MicrosoftAppPassword keys instead of just simply appid and app password keys within the appsettings of the web.config file,
@khakiali Same problem here. How did you solve it?
Same here. Bumping.
Guys check this - https://docs.botframework.com/en-us/support/troubleshooting-bot-framework-authentication/ . I had the same issue. Following the steps in this url fixed it.
When you use localhost you don't need to specify the credentials in the emulator and in the code too. Credentials come to use when you deploy it to Azure.
@saurabhabh that link is dead for me.
I am having a similar issue using the bot on azure running through the emulator. It works without credentials, but not with the credentials (in the emulator). Have MicrosoftAppId and MicrosoftAppPassword set in the web.config and have taken the id and password from the application registration portal. Wanting to get it working through webchat, but at this point can't even see it in the emulator.
I think you need to publish your bot so as it could make use of the credentials. For the local emulator which is just for testing you don't need credentials.
For testing with directline etc, you need an app id and password. This is before the bot is published.
@McGern: here's the correct link.. https://docs.microsoft.com/en-us/bot-framework/troubleshoot-authentication-problems. I guess you must have solved your issue by now anyways.
Thanks for the link.
Think I ended up having to remove something in that was in the register method of the bot. It was bypassing the builtin authentication somehow and needed to do it manually (that led to a host of other issues). I am not sure if what I have is right but it seems to work for now.
Is anyone else experiencing this problem now, out of the blue? I have a bot running, and have had it running, for months with no issues. It's using botbuilder 3.6.0, and there have been no changes to the code that would cause this. In the morning it was working, and suddenly it started throwing this error about refresh access token failed with status code 400. Is anyone else seeing this, or does anyone have any thoughts? Troubleshooting the authentication problem hasn't helped me. My ID and PWD are correct (I didn't change them anyway).
Up, same here. Happened with no reason today killing all my bots running for weeks without issues.
Tried so far:
- Regenerating appId and appPassword
- Updating botbuilder node package
Nope, I'm using 3.8.4 already released 2 months ago https://www.npmjs.com/package/botbuilder
Same here. [Tue Jul 25 2017 15:18:13 GMT-0400 (EDT)] ERROR Error: Refresh access token failed with status code: 400
Also having this issue, since about 30 mins ago. Tried
- regenerating appId and appPassword
- creating new bot and using that one's appId and appPassword
- updating node packages
same here on 3.8.4. Worked yesterday...