alist icon indicating copy to clipboard operation
alist copied to clipboard

Google刷新令牌400

Open zsbai opened this issue 3 years ago • 7 comments

Please make sure of the following things

  • [X] I have read the documentation.
  • [X] I'm sure there are no duplicate issues or discussions.
  • [X] I'm sure it's due to alist and not something else(such as Dependencies or Operational).
  • [X] I'm sure I'm using the latest version

Alist Version / Alist 版本

v3.4.0

Driver used / 使用的存储驱动

Google drive

Describe the bug / 问题描述

使用文档中的https://tool.nn.ci/google/request 点击获取code会出现400: invalid_request,如图: 图片 使用自己的client_id & client_secret并发布应用依旧是此错误,所以排除是公共id的问题,详细错误为:

错误 400:invalid_request The out-of-band (OOB) flow has been blocked in order to keep users secure. Follow the Out-of-Band (OOB) flow migration guide linked in the developer docs below to migrate your app to an alternative method. 请求详情: redirect_uri=urn:ietf:wg:oauth:2.0:oob

但是如果不发布应用,refresh_token会出现隔几天失效的情况,届时访问会出现invalid_grant报错

但是rclone却可以在本地连接到已发布应用后生成refresh_token,希望可以修复

Reproduction / 复现链接

https://tool.nn.ci/google/request

Logs / 日志

No response

zsbai avatar Nov 15 '22 15:11 zsbai

顺便一提,最新版中谷歌存储分片大小一直显示Unknown type

图片

zsbai avatar Nov 15 '22 15:11 zsbai

同样的问题 能解决吗

weizai408 avatar Dec 08 '22 13:12 weizai408

同样的问题 能解决吗

用rclone获取到刷新令牌后复制token到alist

zsbai avatar Dec 09 '22 14:12 zsbai

Any way to go around this problem? found similar problem on rclone forum

jackthenewbie avatar Jan 13 '23 04:01 jackthenewbie

Any way to go around this problem? found similar problem on rclone forum

I think the code wich used for authorization should be updated. Maybe Google has updated the api. Rclone 1.60 can get the refresh_token normally. You can try to use rclone authrize the application and paste the refresh_token from rclne config file to alist.

zsbai avatar Jan 13 '23 07:01 zsbai

For future searcher, run rclone config (version >1.60) -> create new remote -> drive, when it ask client_id & client_secret, take from the site, then keep pressing Enter till you see option choose teamdrive/sharedrive (can't remember), choose or not depend on you. The end you'll see refresh_token, can confirm zsbai's recommendation works. Thanks zsbai.

jackthenewbie avatar Jan 13 '23 07:01 jackthenewbie

For future searcher, run rclone config (version >1.60) -> create new remote -> drive, when it ask client_id & client_secret, take from the site, then keep pressing Enter till you see option choose teamdrive/sharedrive (can't remember), choose or not depend on you. The end you'll see refresh_token, can confirm zsbai's recommendation works. Thanks zsbai.

you are welcome:)

zsbai avatar Jan 13 '23 13:01 zsbai

This should have be fixed in https://github.com/alist-org/docs/commit/f217e5f5f75850a18eff5c4527ea495fe8d17979

xhofe avatar Feb 17 '23 10:02 xhofe