简体   繁体   English

获得服务帐户无法邀请没有全域授权的与会者,即使已经授予全域授权

[英]getting Service accounts cannot invite attendees without Domain-Wide Delegation of Authority eventhough already granted Domain-Wide Delegation

I'm using a service account to create calendar entries and adding new attendees for creating new appointments there is no problem我正在使用服务帐户创建日历条目并添加新的与会者以创建新的约会没有问题

https://www.googleapis.com/calendar/v3/calendars/%7Bin_creator%7D/events

When adding new attendees, I get the error:添加新与会者时,出现错误:

"Service accounts cannot invite attendees without Domain-Wide Delegation of Authority". “服务帐户不能在没有全域授权的情况下邀请与会者”。

for adding new invitees I use:添加新的被邀请者我使用:

https://www.googleapis.com/calendar/v3/calendars/%7BOwner%7D/events/%7Bmeeting_id%7D

All the information in the body of the call (including the list of attendees) ({Owner} is the real owner the calendar, it's not the service account)通话正文中的所有信息(包括与会者列表)({Owner} 是日历的真正所有者,不是服务帐户)

I'm the Google Workspace admin, so I already granted scopes in the Domain-wide Delegation screen to this service account:我是 Google Workspace 管理员,所以我已经在全域委派屏幕中向此服务帐号授予范围:

the owner of the calendar granted " Make Changes Event " permission to the service account日历的所有者授予服务帐户“进行Make Changes Event ”权限

the JWT for request the access token looks like:请求访问令牌的 JWT 如下所示:

{
  "iss": "xxxxxx.gserviceaccount.com",
  "scope": "https://www.googleapis.com/auth/calendar https://googleapis.com/auth/calendar.events https://googleapis.com/auth/admin.directory.resource.calendar",
  "aud": "https://oauth2.googleapis.com/token",
  "exp": "{exp}",
  "iat": "{iat}"
}

I've tried calling the apis using Oracle PLSQL / Apexx using我尝试使用 Oracle PLSQL / Apexx 调用 api

apex_web_service.make_rest_request(
  p_url => t_url, 
  p_http_method => 'POST', 
  p_body => t_json_in, 
  p_parm_name => apex_util.string_to_table(
    'conferenceDataVersion:supportsAttachments:maxAttendees:sendNotifications:sendUpdates'
  ), 
  p_parm_value => apex_util.string_to_table('1:True:12:False:False')
);
where 
  t_url : variable cointaining the target endpoint : xxxx googleapis.com / calendar / v3 / calendars / {Owner} / events / {meeting_id} which returns a CLOB containing a JSON t_json_in : variable with a JSON with all the event data

this function returns a CLOB with a JSON这个 function 返回一个带有 JSON 的 CLOB

{
  "error": {
    "errors": [
      {
        "domain": "calendar",
        "reason": "forbiddenForServiceAccounts",
        "message": "Service accounts cannot invite attendees without Domain-Wide Delegation of Authority."
      }
    ],
    "code": 403,
    "message": "Service accounts cannot invite attendees without Domain-Wide Delegation of Authority."
  }
}

For delegation the JWT for the access token request needs to include the Sub claim.对于授权访问令牌请求的 JWT 需要包含 Sub 声明。 see: service-account 请参阅:服务帐户

sub The email address of the user for which the application is requesting delegated access. sub 应用程序为其请求委派访问的用户的 email 地址。

This is the email address of the owner of the account for which delegation has been configured.这是已配置委托的帐户所有者的 email 地址。 The service account it self may have read access but to have write access it needs to be deligated.它自己的服务帐户可能具有读取权限,但要具有写入权限,则需要进行委托。

{
  "iss": "xxxxxx.gserviceaccount.com",
  "sub": "owner@yourdomain.com"
  "scope": "https://www.googleapis.com/auth/calendar https://googleapis.com/auth/calendar.events https://googleapis.com/auth/admin.directory.resource.calendar",
  "aud": "xxxx oauth2.googleapis.com/token",
  "exp": "{exp}",
  "iat": "{iat}"
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误:服务帐户无法在没有全域授权的情况下邀请与会者 - Error: Service accounts cannot invite attendees without Domain-Wide Delegation of Authority 第三方应用程序被禁用时的域范围授权 - Domain-Wide Delegation of Authority while Third Party Apps are Disabled Gmail API 域范围的委派 - Gmail API domain-wide delegation 不再能够看到为Google服务帐户启用域范围的授权的选项 - No longer able to see option to enable domain-wide delegation of authority for google service account 是否可以在gdata-python-client中使用“域范围授权”? - Is it possible to use “Domain-wide Delegation of Authority” with gdata-python-client? 如何以编程方式为 Google 日历 API 请求域范围的委派? - How to programmatically request domain-wide delegation for Google Calendar API? 哪些Google API支持OAuth2域范围委派? - Which Google APIs support OAuth2 Domain-Wide Delegation? 通过域范围委派模拟用户的服务帐户访问 Google Sheets API 失败 - Accessing Google Sheets API through a service account impersonating a user through domain-wide delegation fails 使用域范围内的委派服务帐户从Google App Engine访问GDrive - Accessing GDrive from Google App Engine with domain-wide delegation service account 启用了域范围委派的应用程序是否可以通过模拟超级管理员来完成超出范围允许的范围? - Can applications with Domain-Wide Delegation enabled do more than the scopes allow by impersonating a superadmin?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM