user6778410
user6778410

Reputation:

Authenticate users for Dialogflow skype integration

I am developing a Chatbot in Dialogflow with Skype integration. I am using Node.js as my fulfillment hosted in my companies Amazon instance. Everything works fine for me but I want to validate the user to apply authentication. Below is the incoming request coming from Skype to Node.js server. I want to check for user's skype display name with the below information. Please advise

{
  "responseId": "a11dcea4-4139-4da0-acac-5ff0f2960a71",
  "queryResult": {
    "queryText": "Hi",
    "action": "input.welcome",
    "parameters": {},
    "allRequiredParamsPresent": true,
    "intent": {
      "name": "projects/grantthornton-f364a/agent/intents/6cb8b646-1987-4c61-967a-523d6f95120c",
      "displayName": "Default Welcome Intent"
    },
    "intentDetectionConfidence": 1,
    "languageCode": "en"
  },
  "originalDetectIntentRequest": {
    "source": "skype",
    "payload": {
      "data": {
        "agent": "botbuilder",
        "attachments": [],
        "address": {
          "bot": {
            "name": "Grant Thornton",
            "id": "28:dc14d048-a865-4a7e-b858-77c816168d41"
          },
          "serviceUrl": "https://smba.trafficmanager.net/apis/",
          "id": "1537967468315",
          "user": {
            "id": "29:1CviHdp_3lKfUNk4dS5js__GFx05DUl6AEl53ujxWGxIHXRFZFYfIUDax8pi5N7yF"
          },
          "conversation": {
            "id": "29:1CviHdp_3lKfUNk4dS5js__GFx05DUl6AEl53ujxWGxIHXRFZFYfIUDax8pi5N7yF"
          },
          "channelId": "skype"
        },
        "entities": [
          {
            "country": "US",
            "type": "clientInfo"
          }
        ],
        "sourceEvent": {
          "text": "Hi"
        },
        "text": "Hi",
        "source": "skype",
        "type": "message",
        "user": {
          "id": "29:1CviHdp_3lKfUNk4dS5js__GFx05DUl6AEl53ujxWGxIHXRFZFYfIUDax8pi5N7yF"
        },
        "timestamp": "2018-09-26T13:11:08.324Z"
      },
      "source": "skype"
    }
  },
  "session": "projects/grantthornton-f364a/agent/sessions/a8c89625-dbeb-441f-ac1c-ad31f10a5afe"
}

Upvotes: 1

Views: 229

Answers (1)

lukedavis
lukedavis

Reputation: 384

The only user information you have here is

"id": "29:1CviHdp_3lKfUNk4dS5js__GFx05DUl6AEl53ujxWGxIHXRFZFYfIUDax8pi5N7yF"

Which you might be able to use by directly querying Skype's API for additional user data.

As an additional note: just getting the user's display name, doesn't handle authentication.

Upvotes: 1

Related Questions