DavidCG
DavidCG

Reputation: 141

Can't get conversationUpdate activity with the Enhanced Direct Line Authentication Features

I'm trying to use the Enhanced Direct Line Authentication Features so I can get rid of the Magic Number.

I just enabled this option and added the trusted origin (https://mychatbot.azurewebsites.net/ <- Not the real one, but is stored on Azure) to the DirectLine.

Then on the code of the website I request the token:

const options = {
  method: 'POST',
  uri: 'https://directline.botframework.com/v3/directline/tokens/generate',
  headers: {
    "Authorization": "Bearer MyDirectLineSecret"
  },
  json: {
      User: {
        id: "dl_" + uuid.v4(),
        name: "UserTest"
      },
      trustedOrigins: ["https://mychatbot.azurewebsites.net/"]

}

Then I make the request for the token:

const response = await rp(options);
const token = response.token;

Like that I have the token and when I go to my bot website (https://mychatbot.azurewebsites.net/) I don't send the updateActivity request and can't send the user the welcome message.

I don't know if I'm doing something wrong about the DirectLine configuration.

Is there anything I should change? I'm using an app service for the bot framework and inserting directly the webchat uri in the trusted origins. I don't know if I am wrong in the request of the token.

Upvotes: 0

Views: 371

Answers (1)

tdurnford
tdurnford

Reputation: 3712

You aren't doing anything wrong. This is a known issue in the DirectLine Connector Service, and the development team is currently working to resolve the issue. Essentially, the second conversation update is not being sent because the user id in the token is causing an error. For more details, checkout this issue on Github. I'll be sure to let you know when it is resolved as well. In the meantime, I would recommend taking a look at the Web Chat Backchannel Welcome Event sample.

Upvotes: 1

Related Questions