Comments (17)
OK. So it's not just me who is running into this problem. I think the original online token generation tool is broken for "Step 5 - Exchange Access Token", i.e, fetching the access_token
and the refresh_token
. I was able to fetch the code
using the online tool in "Step 4 - Authorize for code", and make a POST
request manually to https://login.microsoftonline.com/common/oauth2/v2.0/token
using Insomnia for the refresh_token
.
Resolving the problem (en_US)
The request should be structured as follows:
POST https://login.microsoftonline.com/common/oauth2/v2.0/token
Content-Type: application/x-www-form-urlencoded
client_id={client_id}&redirect_uri={redirect_uri}&client_secret={client_secret}
&code={code}&grant_type=authorization_code
And for Chinese 21Vianet OneDrive users.
POST https://login.chinacloudapi.cn/common/oauth2/v2.0/token
Content-Type: application/x-www-form-urlencoded
client_id={client_id}&redirect_uri={redirect_uri}&client_secret={client_secret}
&code={code}&grant_type=authorization_code
解决办法(zh_CN)
最后一步需要如下构造请求:
POST https://login.microsoftonline.com/common/oauth2/v2.0/token
Content-Type: application/x-www-form-urlencoded
client_id={client_id}&redirect_uri={redirect_uri}&client_secret={client_secret}
&code={code}&grant_type=authorization_code
对 OneDrive 世纪互联用户来说:
POST https://login.chinacloudapi.cn/common/oauth2/v2.0/token
Content-Type: application/x-www-form-urlencoded
client_id={client_id}&redirect_uri={redirect_uri}&client_secret={client_secret}
&code={code}&grant_type=authorization_code
This authorization process is documented at: Authorization and sign-in for OneDrive in Microsoft Graph | Code flow. Can you try this method?
from onedrive-cf-index.
Considering @spencerwooo had already demonstrated Chinese 21Vianet OneDrive
's manually POST method, I changed my fork README.md
to ( just ) a quick tutorial ( in Chinese ) . Respect 😎
from onedrive-cf-index.
Step 5, the process in which the user gets the
refresh_token
.
My apologies if I haven't made this totally clear. The online tool is broken for step 5 along with all further steps, for the step to get the refresh_token
you'll have to perform the actual request manually.
- USE THE ONLINE TOOL on "4. Authorize for code" to get a valid
Code
for the next step. - USE YOUR OWN TOOL TO PERFORM A REQUEST instead of using the online tool's "5. Exchange Access Token".
After these two steps, you'll get what you need: your access_token
and your refresh_token
.
from onedrive-cf-index.
Also works in my case - many thanks!!!
from onedrive-cf-index.
@rokibhasansagar See #58 if you can read Chinese, basically it's just a matter of storing your over-length access token through Cloudflare KV storage instead of Cloudflare secrets.
from onedrive-cf-index.
Plz do read error_description
carefuly, it complains a invalid scope
which should be like this screenshot:
from onedrive-cf-index.
@polychromate Please open a new issue to discuss your problems. ❤️
from onedrive-cf-index.
All right, I'll leave a note in README.md
afterwards.
from onedrive-cf-index.
My apologies for reopening this issue, but it looks like the redirect_uri
is invalid now. It shows an error redirect_uri value must be a valid absolute URI
everytime I try to get the code. Any help is greatly appreciated :)
from onedrive-cf-index.
My apologies for reopening this issue, but it looks like the
redirect_uri
is invalid now. It shows an errorredirect_uri value must be a valid absolute URI
everytime I try to get the code. Any help is greatly appreciated :)
@riglaze Which step? Did you try using Postman / Insomnia to perform the second request manually?
from onedrive-cf-index.
@riglaze Which step?
Step 5, the process in which the user gets the refresh_token
. I used the guide you linked, but it gives me that error
Did you try using Postman / Insomnia to perform the second request manually?
Not yet. Will give it a shot soon
from onedrive-cf-index.
Step 5, the process in which the user gets the
refresh_token
.My apologies if I haven't made this totally clear. The online tool is broken for step 5 and all further steps, for the step to get the
refresh_token
you'll have to perform the actual request manually.
- USE THE ONLINE TOOL on "4. Authorize for code" to get a valid
Code
for the next step.- USE YOUR OWN TOOL TO PERFORM A REQUEST instead of using the online tool's "5. Exchange Access Token".
After these two steps, you'll get what you need: your
access_token
and yourrefresh_token
.
Thanks for the help. It is clear now
from onedrive-cf-index.
On Step 5. Exchange Access Token from https://heymind.github.io/tools/microsoft-graph-api-auth, I got refresh_token of 1031 character.
EDIT: I tried manual method using Postman, still getting tokens of same length
Then on last step Refresh Token, I pasted that token and got back another token of 1038 character.
I guess the final one is the token which needs to be on the CF Worker.
But CF Worker does not accept secret/token larger than 1kB and I get error while putting secret through wrangler, Your secret is too large, it must be 1kB or less
.
What should be done?
from onedrive-cf-index.
@spencerwooo Can you write it in Chinese? I also met this problem but I can't read it. I can't read English, please.
from onedrive-cf-index.
When i use insomnia, it always show me error70000, I don't know why.
from onedrive-cf-index.
hi @polychromate , looks like code
has expired, try to refresh it(the authorization code
).
from onedrive-cf-index.
@beetcb I resend a new code, now it shows me error70011.
The provided value for the input parameter 'scope' is not valid. The scope 'offline_access$20Files.Read Files.Read.All' does not exist.
from onedrive-cf-index.
Related Issues (20)
- wrangler login 执行时卡在 Waiting for API token... HOT 2
- 希望能添加个视图预览 HOT 1
- cloudflare works 使用路由开文件提示重定向次数过多 HOT 1
- 关于上传文件问题
- Custom domain does not works HOT 1
- 从使用 wrangler 添加 Cloudflare Workers 环境变量开始报错(小白求助) HOT 10
- [bug?] OAuth Refresh token过期 HOT 2
- Preview cache (seems to) break Markdown preview
- 使用Insomnia获取refresh_token被告知code已过期
- 从6月份开始,Cf用户报错Worker threw exception,我这边报错Script Threw Exception,重新再来还是如此。 HOT 1
- Error 1101 Worker threw exception HOT 2
- 能否添加一个图床功能 HOT 2
- 叨扰大佬一下 我捣鼓了一晚上 一直获取不了refresh_token HOT 1
- It's not necessary to register new applications HOT 1
- 找不到 zone_id HOT 4
- Publish时出现以下错误 HOT 4
- 输入wrangler login 命令后报错 HOT 1
- Custom Domain Worker threw exception 1101 [自訂域名拋出 1101 錯誤] HOT 1
- 在进行到修改 src/config/default.js后该怎么办呢,是像原heymind一样将js填入worker的部署页面还是怎么操作呢(本人纯新手,不懂wrangler知识) HOT 1
- Markdown渲染base64编码图片时出现错误
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from onedrive-cf-index.