Authentication
Authentication is a common process on all the Applications, for Chatbots or Webhooks isnt an exception.
Gives us multiple benefits like
- A Security layer, so noone more than us can access to our webhook.
- Security to the owner of the chatbot.
How Authentication works?
- When Dialoglow sends a Request to our webhook, our webhook checks the headers.
- We catch headers user/password (for example) and compare with the user/password that we declared on our webhook side. If the parameters are not equal, our webhook will send an Error message and close the connection/port.
- If the Authentication goes fine, we check the requests, goes to especific intents...
Variables used for Authentication
- Currently we are using a basic and strong Authentication.
- As you see in our Core Chatbot file there is a function called auth which received 2 parameters, a name and a password, these variables are declared inside of the variables file that is inside of our chatbot.
- So first lets check these variables, choose the name and password that best fits to you.
Checking on Dialogflow the Variables
- After setting the name/password we are expecting from our Chatbot/Webhook lets go to Dialogflow, especifically in Fulfillment, right there you will see your webhook enabled and some fields named as Basic Auth.
- With that you should be able to Authenticate successfully. Hope this helps you a lot.
- There are other methods for Authenticate in Future but there are Alpha by the time.