使用 Google Document AI(表单解析器 API)进行身份验证
我一直在尝试从解析器 API 进行身份验证,但没有成功。 我已经设置了 google 服务帐户并创建了两个密钥。我已经设置了所有者角色并下载了凭证 json 文件。
googleAuthR::gar_auth_service("D:/898 sample/document ai/form-898-scan-bd4b8b48b570.json")
library(daiR)
response1 <- dai_sync("D:/test file.pdf"
,
proj_id = get_project_id(path = "D:/crudentialabc123.json"),
proc_id = "e4xxxxxx",
loc = "us",
token = dai_token(
path = Sys.getenv("GSC_AUTH_FILE")
# scopes = "https://googleapis.com/auth/cloud-platform"
)
)
我不断收到 403 权限被拒绝错误。
File submitted at 2022-04-10 05:17:57. HTTP status: 403 - unsuccessful.
Error: "Permission 'documentai.processors.processOnline' denied on resource '//documentai.googleapis.com/projects/projectname/locations/us/processors/e4xxxxxxx' (or it may not exist)."
Response [https://us-documentai.googleapis.com/v1/projects/projectname/locations/us/processors/e46888f802fea83d:process]
Date: 2022-04-10 05:17
Status: 403
Content-Type: application/json; charset=UTF-8
Size: 649 B
{
"error": {
"code": 403,
"message": "Permission 'documentai.processors.processOnline' denied on resource '//documentai.googleapis.com/projects/form-898-scan/locations/us/processors/e46...
"status": "PERMISSION_DENIED",
"details": [
{
"@type": "type.googleapis.com/google.rpc.ErrorInfo",
"reason": "IAM_PERMISSION_DENIED",
"domain": "documentai.googleapis.com",
...
任何帮助将不胜感激!
I have been trying to authenticate from the parser API without success.
I have set up the google service account and created two keys.I Have set up the owner role and downloaded the credential json file.
googleAuthR::gar_auth_service("D:/898 sample/document ai/form-898-scan-bd4b8b48b570.json")
library(daiR)
response1 <- dai_sync("D:/test file.pdf"
,
proj_id = get_project_id(path = "D:/crudentialabc123.json"),
proc_id = "e4xxxxxx",
loc = "us",
token = dai_token(
path = Sys.getenv("GSC_AUTH_FILE")
# scopes = "https://googleapis.com/auth/cloud-platform"
)
)
I keep getting the 403 permission denied error.
File submitted at 2022-04-10 05:17:57. HTTP status: 403 - unsuccessful.
Error: "Permission 'documentai.processors.processOnline' denied on resource '//documentai.googleapis.com/projects/projectname/locations/us/processors/e4xxxxxxx' (or it may not exist)."
Response [https://us-documentai.googleapis.com/v1/projects/projectname/locations/us/processors/e46888f802fea83d:process]
Date: 2022-04-10 05:17
Status: 403
Content-Type: application/json; charset=UTF-8
Size: 649 B
{
"error": {
"code": 403,
"message": "Permission 'documentai.processors.processOnline' denied on resource '//documentai.googleapis.com/projects/form-898-scan/locations/us/processors/e46...
"status": "PERMISSION_DENIED",
"details": [
{
"@type": "type.googleapis.com/google.rpc.ErrorInfo",
"reason": "IAM_PERMISSION_DENIED",
"domain": "documentai.googleapis.com",
...
Any help would be appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议您使用R.
https://cran.r-project.org/web/packages/googleauthr/vignettes/google-authentication-ytypes.html
当前,Google Cloud cloud没有任何r的客户端库,但是列出的第三方软件包应该能够提供一个起点。
I would recommend reviewing this blog post about Google authentication using R.
https://cran.r-project.org/web/packages/googleAuthR/vignettes/google-authentication-types.html
Currently, Google Cloud doesn't have any client libraries for R, but the 3rd party packages listed should be able to provide a starting point.