Admin

【教程】OneDrive-Index-Cloudflare-Worker获取refresh_token失败BUG修复

仓库地址:https://github.com/heymind/OneDrive-Index-Cloudflare-Worker
安装过程请看仓库README,这里不做赘述

由于前段时间:dd.1234234.xyz的onedrive节点突然异常,访问限制Worker threw exception,我第一时间还以为是账号出啥情况了,在debug之后发现原来是有段时间由于该节点一直没人访问,导致refresh_token过期失效了,报错信息如下:

{"error":"invalid_grant","error_description":"AADSTS700082: The refresh token has expired due to inactivity. The token was issued on 2021-04-09T20:24:13.7429736Z and was inactive for 90.00:00:00.\r\nTrace ID: fc3c1f0d-acf2-497c-ba0f-9d7087f63900\r\nCorrelation ID: 9ecc7d33-6640-4f96-979e-729c0081f737\r\nTimestamp: 2021-09-05 19:12:37Z","error_codes":[700082],"timestamp":"2021-09-05 19:12:37Z","trace_id":"fc3c1f0d-acf2-497c-ba0f-9d7087f63900","correlation_id":"9ecc7d33-6640-4f96-979e-729c0081f737","error_uri":"https://login.microsoftonline.com/error?code=700082"}

故而尝试重新获取一个新的值,在该过程中遇到了如下BUG:

{"error":"invalid_request","error_description":"AADSTS9002326: Cross-origin token redemption is permitted only for the 'Single-Page Application' client-type.\r\nTrace ID: 5f4789ca-3de2-4dd1-8060-9bfff1d33b00\r\nCorrelation ID: b546ee9d-faf8-4b35-8a69-9a856521e566\r\nTimestamp: 2021-09-05 19:07:51Z","error_codes":[9002326],"timestamp":"2021-09-05 19:07:51Z","trace_id":"5f4789ca-3de2-4dd1-8060-9bfff1d33b00","correlation_id":"b546ee9d-faf8-4b35-8a69-9a856521e566","error_uri":"https://login.microsoftonline.com/error?code=9002326"}

这里记录下如何解决:首先还是一样,获取一个Code值,在图中的client id填入对应的值后点击Authorize:

在获取到Code后我们便开始获取refresh_token,填入我们的client_secret:

这时候先别急着点GET TOKEN,我们打开BurpSuite(抓包工具,此处可以替换为其他软件)进行抓包:

右键将数据发送到repeater重复模块:

删除其中的origin字段后点击Go:

成功获取:

已有 2 条评论

  1. dixmiktmgo · 2025-03-03 03:14:48

    ?学术类评语?

  2. rvfshoqjad · 2025-03-03 21:08:06

    古典诗词化用自然,毫无斧凿痕迹。