How to authenticate Dialogflow fulfillment

388 views
Skip to first unread message

Stig B. Andersen

unread,
Apr 6, 2020, 12:31:36 PM4/6/20
to dialogflow-enterprise-edition-users
Hi,

I'm kind of stuck with this one so any help is appreciated! :-)

I've created a Dialogflow agent which uses a fulfillment webhook. The webhook backend is run in the Google Cloud Platform as a Cloud function.

The configuration of the webhook is pretty simple as can be seen on the screenshot below:




Udklip.PNG















Initially, I didn't have any security restrictions set on my Cloud Function as 'allUsers' could access it (See below):


Udklip.PNG



Using this configuration everything worked as expected. When I tested my Intents in Dialogflow I got an answer back from my fulfillment webhook. So far so good! :-)

Since I don't want everyone to be able to access my GCP Cloud Function I've removed the 'allUsers' from the 'Cloud Functions Invoker' list as can be seen below:


Udklip.PNG
















After removing 'allUsers' from the 'Cloud Functions Invoker' list the DialogFlow fulfillment webhook is no long able to access the GCP Cloud Function and this is my problem.

As far as I've understood the Dialogflow runs under a specific 'Service Account' which can be obtained on the General tab of the Dialogflow (See below)



Udklip.PNGAs far as I've understood the Dialogflow runs under a specific 'Service Account' which can be obtained on the General tab of the Dialogflow (See below). 
That 'Service Account' must have access to envoke the GCP Cloud Function which I thought that it would have if it was added to the 'Cloud Function Invoker' list.
Since I've added the Dialogflow service account to the GCP Cloud Function Invoker list without solving the problem something else must be wrong - but what!?


Best regards
Stig Andersen




George Suceveanu

unread,
Apr 9, 2020, 4:02:13 PM4/9/20
to dialogflow-enterprise-edition-users
Hello Stig, 

How did you set up the service account you mentioned? Details may be of importance here. You may refer to the "Setting up Authentication" sub-chapter of the "Quickstart: Setup" page. In particular, it may be worthwhile checking the way you set up the GOOGLE_APPLICATION_CREDENTIALS environment variable. What role have you assigned to this service account? You may consider granting it first the "Owner" role, to see if you get it working properly, to start with.   

xuechen zhang

unread,
Apr 26, 2021, 12:06:57 PM4/26/21
to Dialogflow Essentials Edition users
Hi Stig,

I am so glad I found your post here. I am facing the exact same issue. May I ask if this issue has been solved yet and how was it solved? Thanks!

Xuechen

Olusayo Akinlaja

unread,
Apr 27, 2021, 12:05:18 PM4/27/21
to Dialogflow Essentials Edition users
Hello, Xuechen

While I do not have any information about the resolution of the issue for Stig, I am interested in knowing the error you are obtaining whenever you make the call. 
Can you provide the info please?

xuechen zhang

unread,
Apr 27, 2021, 12:45:40 PM4/27/21
to Dialogflow Essentials Edition users
Hi Olusayo,

The error message in the diagnosis information shows  "Webhook call failed. Error: UNKNOWN". And this happens when it is switched to "Require Authentication" in the cloud function side.

Thanks.
Xuechen

Reply all
Reply to author
Forward
0 new messages