Google Directory API - 将成员添加到在本地主机上工作的组,但在使用 Spring Boot 上传到服务器后不起作用

问题描述

我正在尝试使用 GSuite Directory API 将成员添加到组。当我从本地主机运行时它工作正常。我收到以下回复

{
    "email": "[email protected]","etag": "\"KXerOJ--uaTsC20LSIhZ0glQU94e8VcBOkFuJ9bRTN0/JkFTvv9f6ckddpl66l1esjGJWrc\"","id": "117999918144210502865","kind": "admin#directory#member","role": "MEMBER","type": "USER","status": "ACTIVE"
}

但是当我将它上传到 WebSphere 服务器并运行相同的东西时,它给了我以下响应。

403 Forbidden
POST https://www.googleapis.com/admin/directory/v1/groups/03vac5uf1al10ml/members
{
  "code" : 403,"errors" : [ {
    "domain" : "global","message" : "Insufficient Permission","reason" : "insufficientPermissions"
  } ],"message" : "Request had insufficient authentication scopes.","status" : "PERMISSION_DENIED"
}

我检查了范围,对我来说似乎很好。有没有人建议我应该检查哪些其他事项。

下面是我的credentials.json文件

{"installed":{"client_id":"xxx","project_id":"studentupdate","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://oauth2.googleapis.com/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","client_secret":"xxxx","redirect_uris":["urn:ietf:wg:oauth:2.0:oob","http://localhost"]}}

谢谢

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)