我正在通过gcloud命令:gcloud auth application-default login --scopes='https://www.googleapis.com/auth/drive'向访问令牌添加作用域。当我只添加一个作用域时,它可以正常工作,但是每当我尝试添加另一个类似于so gcloud auth application-default login --scopes='https://www.googleapis.com/auth/drive https://www.googleapis.com/auth/cloud-platform'的作用域时,我就会被带到同意屏幕上,在那里我看到了提供的作用域。接受后,我在我的终端机里得到了这个:
ERROR: gcloud crashed (Warning): Scope has changed from "https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/drive https://www.googleapis.com/auth/accounts.reauth" to "https://www.googleapis.com/auth/accounts.reauth https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/drive"知道为什么会这样吗?我是不是没有正确地通过范围?
注意:显示的范围已经添加到GCP上的控制台中。
发布于 2022-04-04 18:18:26
尝试删除范围列表中任何位置的空格,使用逗号分隔每个作用域(除了以引号括起整个列表外),如下所示:
gcloud auth application-default login --scopes='https://www.googleapis.com/auth/drive,https://www.googleapis.com/auth/cloud-platform'我最初使用您的命令收到了相同的错误,但是在查看了这个发行报告之后,当空格出现时,它是由gcloud解析参数不正确造成的。使用上面的命令在我的测试中解决了这个问题。
https://stackoverflow.com/questions/71720360
复制相似问题