OneDrive Client ID & Secret not working

What is the problem you are having with rclone?

I am trying to add a OneDrive business drive into rclone. When using my own client ID and Secret I get an error message, but using the default (blank) option it configures the drive just fine. I followed this guide

Not sure what the final steps mean

" Now the application is complete. Run rclone config to create or edit a OneDrive remote. Supply the app ID and password as Client ID and Secret, respectively. rclone will walk you through the remaining steps."

I just add the Client ID and Secret into rclone, I didn't see any App ID and password option?

What is your rclone version (output from rclone version)

rclone v1.54.0

  • os/arch: windows/amd64
  • go version: go1.15.7

Which OS you are using and how many bits (eg Windows 7, 64 bit)

Windows 10, 64 Bit

Which cloud storage system are you using? (eg Google Drive)

Microsoft OneDrive

The command you were trying to run (eg rclone copy /tmp remote:tmp)

Rclone Config

The rclone config contents with secrets removed.



D:\Downloads\New folder\rclone-v1.54.0-windows-amd64>rclone config
Current remotes:

Name                 Type
====                 ====
GoogleDrive          drive
OneDrive             onedrive

e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q> e
Choose a number from below, or type in an existing value
 1 > GoogleDrive
 2 > OneDrive
remote> 2
--------------------
[OneDrive]
type = onedrive
token = {"access_token":"eyJ0eXAiOiJKV1QiLCJub25jZSI6IkxKMTBpNUI5ejhXWlFVUE1vSko3ZGE5M0ZmbVZ1azdidkZtX2kwMHJDTzAiLCJhbGciOiJSUzI1NiIsIng1dCI6Im5PbzNaRHJPRFhFSzFqS1doWHNsSFJfS1hFZyIsImtpZCI6Im5PbzNaRHJPRFhFSzFqS1doWHNsSFJfS1hFZyJ9.eyJhdWQiOiIwMDAwMDAwMy0wMDAwLTAwMDAtYzAwMC0wMDAwMDAwMDAwMDAiLCJpc3MiOiJodHRwczovL3N0cy53aW5kb3dzLm5ldC8zZGY0NmM2YS1iYThkLTQ3NGYtOWE3YS1hZjA5NDhmYTJjZTQvIiwiaWF0IjoxNjE0ODY5NDAyLCJuYmYiOjE2MTQ4Njk0MDIsImV4cCI6MTYxNDg3MzMwMiwiYW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_FSC0VKV2H3vzNZ76K9WAp3MNYyO1sB2D5bQGowfZraQEsOh-vJ5UUwMoO24tRSDIccFM7YpXJD3ry2Kdy3IVAuX5gA6T_Fu3NHDYL5xMLrPXakpl-G_QPfBJk12MJOC2cqliM09mXjdVMFYxububVtlbZsiI2zQGINbIVFgJmSRI_xxzfnqorfchEufq4Y6Gwd6ZKFtjRXTIotjZ9y_vzRwOJRiqnJiNQ86JSiMcecZVIkTAF7HZWrqLcxaxMrJ6aYIUVlrhfyVsAi5hHtEH92TMw6T9fyPqCy3r2qoadqXKJStoovzIHoRPUpy2DhI-RVTe6WELM_YgFVRiMI7MEV4O4v5RruDnZnyejcbVS1mHDmOVJwddlU0NfpUAvXnuQghwaM4IniyEy_ut4HdQS-O_5b3WvVnw1-hd1ejSO7eeNlvjHBFSx6-epePYHEbp_pOgSYohO83lsLtZdW3_EoKGb0zWY1ydyZZ6GU7ktyM03Os6IHyAbGJTcg3lnQ9PGyEisB7Eq5Q1hPtAVwc4UrhvHHecqO-LIsIWhUpabXTIk-1ToFUyhca9eXD08YjGhK0j-OuesD3Z-Z48Kh3k3V9U1BlQVCclbQnpvFEuCrBMRz42VbXO3mnC2_kVkIPo0dqmNnsNNsCafFjbaMnPL-9z-CBL8m7hU14wrHS9LzDmd69b1tkhqCXtGjc_uLz593SK6onaXxyfRW3s2g","expiry":"2021-03-04T23:55:00.8589934+08:00"}
drive_id = b!MZwzbgfF6U6X-Csni4Ny5XYm73QQK4BFvkJyIPhzSPkujykwSfAwS4y-PJrdIHsG
drive_type = business
client_id = 0bab2433-3de3-41a9-97cb-6ace1359f90b
client_secret = 
--------------------
Edit remote
** See help for onedrive backend at: https://rclone.org/onedrive/ **

Value "client_id" = "0bab2433-3de3-41a9-97cb-6ace1359f90b"
Edit? (y/n)>
y) Yes
n) No (default)
y/n>
Value "client_secret" = 
Edit? (y/n)>
y) Yes
n) No (default)
y/n>
Value "region" = ""
Edit? (y/n)>
y) Yes
n) No (default)
y/n>
Edit advanced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D08YjGhK0j-OuesD3Z-Z48Kh3k3V9U1BlQVCclbQnpvFEuCrBMRz42VbXO3mnC2_kVkIPo0dqmNnsNNsCafFjbaMnPL-9z-CBL8m7hU14wrHS9LzDmd69b1tkhqCXtGjc_uLz593SK6onaXxyfRW3s2g","expiry":"2021-03-04T23:55:00.8589934+08:00"}
drive_id = b!MZwzbgfF6U6X-Csni4Ny5XYm73QQK4BFvkJyIPhzSPkujykwSfAwS4y-PJrdIHsG
drive_type = business
client_id = 0bab2433-3de3-41a9-97cb-6ace1359f90b
client_secret = 
--------------------
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y/e/d>
Remote config
Already have a token - refresh?
y) Yes (default)
n) No
y/n>
Make sure your Redirect URL is set to "http://localhost:53682/" in your custom config.
Use auto config?
 * Say Y if not sure
 * Say N if you are working on a remote or headless machine
y) Yes (default)
n) No
y/n>
If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=XNE7xw_2fvyWS19vNmyw6A
Log in and authorize rclone for access
Waiting for code...
Got code
2021/03/04 23:07:22 Failed to configure token: failed to get token: oauth2: cannot fetch token: 401 Unauthorized
Response: {"error":"invalid_client","error_description":"AADSTS7000215: Invalid client secret is provided.\r\nTrace ID: 95d4f255-920c-459e-bad4-d2b25ea41a00\r\nCorrelation ID: 7765d501-04e5-4e3f-8780-d8dd022511cc\r\nTimestamp: 2021-03-04 15:07:23Z","error_codes":[7000215],"timestamp":"2021-03-04 15:07:23Z","trace_id":"95d4f255-920c-459e-bad4-d2b25ea41a00","correlation_id":"7765d501-04e5-4e3f-8780-d8dd022511cc","error_uri":"https://login.microsoftonline.com/error?code=7000215"}

I tried using a different browser and also a new Client ID& Secret but still no success. Not sure what to do?

hello,

please redact the ids and secrets

how are you testing?

I tried using rclone copy. Using to default blank ID and secret I am able to see the file in my onedrive. But with using my own ID and secret i cannot see the file and get this message

D:\Tools For Games\Mount Google Drives\rclone>rclone copy "T:\Rclone Copy Upload 2" "OneDrive:\UploadLocation" -P
2021/03/04 23:58:18 Failed to create file system for "OneDrive:\UploadLocation": failed to get root: Get "https://graph.microsoft.com/v1.0/drives/b!MZwzbgfF6U6X-Csni4Ny5XYm73QQK4BFvkJyIPhzSPkujykwSfAwS4y-PJrdIHsG/root": couldn't fetch token - maybe it has expired? - refresh with "rclone config reconnect OneDrive:": oauth2: cannot fetch token: 401 Unauthorized
Response: {"error":"invalid_client","error_description":"AADSTS7000215: Invalid client secret is provided.\r\nTrace ID: fee2fe41-789c-4a33-a8a0-df4048ba1e00\r\nCorrelation ID: 112fe36b-98ba-47b8-9990-8f8a831ec5cf\r\nTimestamp: 2021-03-04 15:58:19Z","error_codes":[7000215],"timestamp":"2021-03-04 15:58:19Z","trace_id":"fee2fe41-789c-4a33-a8a0-df4048ba1e00","correlation_id":"112fe36b-98ba-47b8-9990-8f8a831ec5cf","error_uri":"https://login.microsoftonline.com/error?code=7000215"}

https://login.microsoftonline.com/error?code=7000215"

Is there anything I can do to solve this?

how did you create the client id?

did you follow this procedure?
https://rclone.org/onedrive/#getting-your-own-client-id-and-key

so i tried for the first time to setup my onedrive.
as first, i failed with the same error as you.
my mistake was to use the ID.
i tried again, using the value and that worked.

1 Like

Thank you very much! Using value did seem to work. Also unrelated question, but when cloud transfering from Google Drive to Microsoft OneDrive can I use server side transfer? Or is that only from same cloud storage providers i.e. Google to Google or Microsoft to Microsoft?

you are very welcome.

sure, you can try --magic :wink:

2 Likes

joke went way over my head as well :slight_smile:

oh great, use my own posts against me.
i guess the joke is on me this time :upside_down_face:

1 Like

Hello,
When you get rcone token, did you remember add clinet_id and secret?
You should get the token by 'rclone authorize onedrive 'client_id' 'secret' '
Did you forget last two parts?

Not sure if I understand your question. But I removed my client id and secret in the first post so other people viewing this thread couldn't use it.

hi,

the solution was as i described it here OneDrive Client ID & Secret not working - #7 by asdffdsa

for the client secret:
need to use the Value, not the ID

Hello,

I have the same problem, but nothing helps.

There is a mysterious effect! I have 20 accounts and only the created id and secret I created nearly one year ago are working and now this :slight_smile:
I create new credentials and when doing "rclone config" to create remotes, it works and I can choose even the drive id.

Plus: When I start the union in a mount, it works for some minutes and then I receive the "Invalif client secret" error.

It's driving me crazy because I tried it X time and always the same :frowning:

Regards.

Did you try using the value instead of client secret?

Hi,

yes, I used the value. I did it the same way like I did 1 year ago.

And I did it step by step, with to browser windows, so to choose the same options like the credentials which are working.

But I am sure, it is another reason... Because the first time when config with rclone "it works!", it shows me the drive-id and I choose it with typing "0".

Then later, doing the same with this credentials it doesn't work.

Maybe the reason is the high number f remotes? (same IP) But... I don't think so. At work we have a proxy firewall and so everybody has the same IP.

But thanks for your answer!

hi,
if it was true, then my solution would have worked.

better to start a new topic, answer all the questions..
the unions mount is another issue; let's get the onedrive remote to work first and then deal with that in another topic.

Î am focused on the OneDrive issue, too.

And I am goin' nuts trying, studying and I am sure it is on MS side some issue. If the credentials work one time, when creating the remote and a little later not ...

... it is hard to belive that we are not able to create some simple user id & secret :smiley:

--

PS: Did you read on Azure that MS changed some things at creating credentials?

no, i did not, if you have a weblink to share, i will take a read.

i have not used onedrive, tho i have a 1TB account.
i had planned to set it up with rclone but never got round to it.
so when the OP was having problems, i decided to set a remote for rclone.
i followed the rclone instructions to get my own client id and key.
that worked.