-
-
Notifications
You must be signed in to change notification settings - Fork 435
Ran into an error while attempting to fetch the access_token
#13
Comments
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 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? |
Also works in my case - many thanks!!! |
All right, I'll leave a note in |
access_token
Considering @spencerwooo had already demonstrated |
My apologies for reopening this issue, but it looks like the |
@riglaze Which step? Did you try using Postman / Insomnia to perform the second request manually? |
Step 5, the process in which the user gets the
Not yet. Will give it a shot soon |
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
After these two steps, you'll get what you need: your |
Thanks for the help. It is clear now |
On Step 5. Exchange Access Token from https://heymind.github.io/tools/microsoft-graph-api-auth, I got refresh_token of 1031 character. 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, What should be done? |
@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. |
@spencerwooo Can you write it in Chinese? I also met this problem but I can't read it. I can't read English, please. |
hi @polychromate , looks like |
|
@polychromate Please open a new issue to discuss your problems. ❤️ |
In the Microsoft Graph API Auth tooling page, when proceeding step 5, I encountered the following message...
As shown, it wants a
Single-Page Application
; however, the platform we are after isWeb
...The text was updated successfully, but these errors were encountered: