botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

Getting ERROR: ChatConnector: receive - invalid token. Check bots app ID & Password with every message.

Open vlttnv opened this issue 10 years ago • 6 comments

After upgrading to v3.1.1 is tarted getting ERROR: ChatConnector: receive - invalid token. Check bots app ID & Password on every received message. This started happening with no change in the code or any modification. #742 claims that the fix is in v3.1.1

vlttnv avatar Jul 27 '16 10:07 vlttnv

This means that you don't have your bot configured with the right Microsoft App Id and Password. As a result we cannot validate JwtTokens sent to your bot. Here is a step by step troubleshoot guide for auth issues.

msft-shahins avatar Jul 27 '16 17:07 msft-shahins

I had a working bot for several weeks then once I updated the npm package to v.3.1.1 it started happening. I verified a few times that I am using the correct credentials and I also created a second bot with completely new credentials. It still happens. This is how I add the credentials to the configuration:

var connector = new builder.ChatConnector({
    appId: process.env.MICROSOFT_APP_ID,
    appPassword: process.env.MICROSOFT_APP_PASSWORD
});

Am I doing something wrong?

vlttnv avatar Jul 28 '16 09:07 vlttnv

If everything is definitely configured correctly, be sure to confirm your (or whatever machine your bot is running on) system time is accurate. Three hours of my life I'll never get back.

stijnvdb88 avatar Jul 30 '16 21:07 stijnvdb88

@vlttnv I'm assuming you solved this issue, if not please reopen. Thanks!

Andrea-Orimoto avatar Aug 26 '16 18:08 Andrea-Orimoto

@Andrea-Orimoto I'm still facing this issue in https://github.com/Microsoft/BotBuilder/issues/710#issuecomment-351025956

loretoparisi avatar Dec 12 '17 11:12 loretoparisi

@loretoparisi Are you running this in docker? I was experiencing clock drift in my containers. Google for docker clock/time drift and you see some solutions.

vlttnv avatar Dec 13 '17 08:12 vlttnv