BugResolver
BugResolver

Reputation: 85

I am using a GCP service account, but when calling Dialog Flow API I get an error

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/.

Upvotes: 3

Views: 3219

Answers (1)

FridayPush
FridayPush

Reputation: 916

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

Upvotes: 3

Related Questions