Google对话框流程PERMISSION_DENIED异常 [英] Google dialogflow PERMISSION_DENIED Exception

查看:99
本文介绍了Google对话框流程PERMISSION_DENIED异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从Windows Java应用程序访问Google DialogFlow.我已经正确设置了环境变量 GOOGLE_APPLICATION_CREDENTIALS ,并且我可以调用其他Google API.但是,当我打电话时:

I am trying to access a Google DialogFlow from a Windows Java application. I have the environment variable, GOOGLE_APPLICATION_CREDENTIALS, properly set and I can call other Google APIs. However, when I call:

DetectIntentResponse响应= sessionClient.detectIntent(session,queryInput);

我收到一个grpc异常:

I receive a grpc exception:

PERMISSION_DENIED:拒绝了'projects/newagent-a0ef5/agent'上的IAM权限'dialogflow.sessions.detectIntent'.会话路径:projects/NewAgent/agent/sessions/xxxx

PERMISSION_DENIED: IAM permission 'dialogflow.sessions.detectIntent' on 'projects/newagent-a0ef5/agent' denied.Session Path: projects/NewAgent/agent/sessions/xxxx

"newagent-a0ef5";是我流程的项目ID."xxxx"只是一个随机的会话ID令牌.

"newagent-a0ef5" is the project ID of my flow. "xxxx" is just a random Session ID token.

我了解我必须启用 dialogflow.sessions.detectIntent 访问权限,但是我无法确定在哪里.我使用该值创建了一个自定义角色,并将其添加到与流程相关联的三个IAM帐户中.我还启用了DialogFlow API.

I understand that I have to enable dialogflow.sessions.detectIntent access, but I cannot figure out where. I created a custom role with that value and added it to the three IAM accounts associated with my flow. I have also enabled the DialogFlow API.

有人知道我在哪里添加此丢失的权限吗?

Does anyone know where I add this missing permission?

推荐答案

我正确执行了所有IAM步骤,但是我将错误的Project ID传递给detectIntent.所以我猜有几件事要检查...

I did all the IAM steps properly, but I was passing the wrong Project ID to detectIntent. So I guess a couple things to check...

  • 确保项目ID是正确的.您的会话路径应为项目/<项目ID>/agent/sessions/<会话ID>".
  • 确保您使用的服务帐户具有Dialogflow API客户端角色.
  • 尝试使其在 API资源管理器

这篇关于Google对话框流程PERMISSION_DENIED异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆