【问题标题】:Authentication with Google Document AI (Form Parser API)使用 Google Document AI(表单解析器 API)进行身份验证
【发布时间】:2023-01-18 02:37:23
【问题描述】:

我一直在尝试从解析器 API 进行身份验证但没有成功。 我已经设置了谷歌服务帐户并创建了两个密钥。我已经设置了所有者角色并下载了凭证 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",
...

任何帮助,将不胜感激!

【问题讨论】:

    标签: r google-cloud-platform cloud-document-ai googleauthr


    【解决方案1】:

    我建议您查看这篇关于使用 R 进行 Google 身份验证的博客文章。

    https://cran.r-project.org/web/packages/googleAuthR/vignettes/google-authentication-types.html

    目前,谷歌云没有任何 R 的客户端库,但列出的第 3 方包应该能够提供一个起点。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-12-29
      • 2013-06-24
      • 2021-08-18
      • 2012-11-27
      • 1970-01-01
      相关资源
      最近更新 更多