spencerwooo / onedrive-cf-index

Deprecated, use new project 👇
https://github.com/spencerwooo/onedrive-vercel-index
MIT License
1.08k stars 439 forks source link

Authorization Failed #148

Closed talha-muneer closed 3 years ago

talha-muneer commented 3 years ago

I am getting an error when I authenticate, although it passes through the phase and I paste whatever I get in address bar but when I paste it in VS Code Terminal (Powershell), it says Get Token Failed! Unauthorized. Please help?

Also, How can I deploy this same thing on workers.dev's domain? which could should I deploy?

reaitten commented 3 years ago
  1. can you show how you did it? make sure you have the right api permissions.
  2. it is possible to deploy on workers.dev domain, you do not need to change anything, just make sure in "wrangler.toml" file, has workers_dev = true
talha-muneer commented 3 years ago
  1. can you show how you did it? make sure you have the right api permissions.
  2. it is possible to deploy on workers.dev domain, you do not need to change anything, just make sure in "wrangler.toml" file, has workers_dev = true

1.How should I show you? DM You or something? Please lemme know that.

  1. Which code I need to paste in there for it to work?
reaitten commented 3 years ago
  1. can you show how you did it? make sure you have the right api permissions.
  2. it is possible to deploy on workers.dev domain, you do not need to change anything, just make sure in "wrangler.toml" file, has workers_dev = true

1.How should I show you? DM You or something? Please lemme know that.

  1. Which code I need to paste in there for it to work?
  1. here is fine.
  2. just make sure your "wrangler.toml" has the following infomation: image
talha-muneer commented 3 years ago

1-If I copy paste the wrangler code in Workers dev, it starts showing so many errors.

2- I installed npm, got the token from cloudflare, made the API in one drive, got the secret ID and client ID, then ran that npm graph command and it took me to authentication page. As it is localhost, it showed nothing on webpage but an error like no page exists something but got the code in address bar, then I pasted that in VS code, it shows authentication failed unauthorized. Then I made the redirection to a cloud worker dev site just to see if authentication is successful and it was working as on retrying, I page hello world appear on page. But whenever I put that code back in the powershell, it stills fails to authenticate. And I have provided all permissions as mentioned in your guide.

talha-muneer commented 3 years ago

Also I cannot find Zone ID for a workers.dev site.

reaitten commented 3 years ago

1-If I copy paste the wrangler code in Workers dev, it starts showing so many errors.

2- I installed npm, got the token from cloudflare, made the API in one drive, got the secret ID and client ID, then ran that npm graph command and it took me to authentication page. As it is localhost, it showed nothing on webpage but an error like no page exists something but got the code in address bar, then I pasted that in VS code, it shows authentication failed unauthorized. Then I made the redirection to a cloud worker dev site just to see if authentication is successful and it was working as on retrying, I page hello world appear on page. But whenever I put that code back in the powershell, it stills fails to authenticate. And I have provided all permissions as mentioned in your guide.

  1. are you copying wrangler.toml code into Cloudflare Workers like this:

image

if so, you should not be doing it like that. i highly recommend you to read the deployment process.

  1. did you use npx @beetcb/ms-graph-cli to retrieve refresh_token?

like as stated in Generating OneDrive API Tokens?

at the address bar, you need to copy everything (ctrl+a, ctrl+c) and paste it into prompt. example:

image

Also I cannot find Zone ID for a workers.dev site.

  1. Zone ID is not required as you wish to use workers.dev domain not a custom domain.
talha-muneer commented 3 years ago

Tried multiple times. Not working. I am although using my University email and I have Microsoft Office A1 account.

reaitten commented 3 years ago

Tried multiple times. Not working. I am although using my University email and I have Microsoft Office A1 account.

please show the steps you took because you are probably doing something wrong. i'd appreciate it if you'd post images of what isn't working.

talha-muneer commented 3 years ago

Got it, I will show you step by step

spencerwooo commented 3 years ago

@talha-muneer You are using your university's SharePoint? I doubt that will work actually because you will need some admin privileges to actually activate your tokens for this project.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.