3

Here is the error:

Your application has authenticated using end user credentials from the Google Cloud SDK or Google Cloud Shell which are not supported by the dialogflow.googleapis.com. We recommend that most server applications use service accounts instead. For more information about service accounts and how to use them in your application, see https://cloud.google.com/docs/authentication/.

DV82XL
  • 5,350
  • 5
  • 30
  • 59
BugResolver
  • 85
  • 1
  • 7
  • I would double check that your application isn't running using the Application default credentials, and that your machine wasn't configured using 'gcloud auth login' or something similar. – FridayPush Nov 21 '18 at 07:10
  • 1
    thanks..!! now it start working i just activate my service account by using gcloud auth activate-service-account --key-file . – BugResolver Nov 21 '18 at 07:55
  • @BugResolver Can you please add your solution as an answer in this post? so everyone could see it better. Thank you in advance. – Alex Riquelme Nov 21 '18 at 11:14

1 Answers1

3

Many of the Client Libraries pull from the Application Default Credentials, a summary of how they're checked is provided on that link. Essentially it will check environmental variables for a path and pull credentials from that location. This error message means you're using a User account, and not a service account.

Most commonly you logged in once using gcloud auth login, and even though you provided your service account it's still pulling from the Application Default location.

As you did, the method to associate a specific service account is gcloud auth activate-service-account --key-file <path>

Alternatively to use the true application default you can use gcloud auth application-default login

Community
  • 1
  • 1
FridayPush
  • 871
  • 5
  • 7
  • also i have change code :let config = { credentials: { private_key: privateKey, client_email: clientEmail } } const sessionClient = new dialogflow.SessionsClient(config); const sessionPath = sessionClient.sessionPath(projectId, sessionId); } – BugResolver Jan 03 '19 at 07:56