Access Token for Rclone

So I literally just started using this (as of like yesterday) and have 0 experience with this but was able to get everything all setup except for I'm not sure where the access token goes. I am setting this up with OneDrive (if that makes any difference in this case) and running on MacOS. Any help is greatly appreciated and I can provide more information if need be. Thanks very much in advance.

You should not need to input any token yourself. this is auto-generated when you authorize from rclone.config

The only info you may need to provide for yourself is client ID and client secret . However, this isn't even required unless you want to use your own private API key (which has some benefits). If you just leave these blank then the default shared rclone API will be used, which works fine for a basic setup.

Let me know what you feel like you need more information on. I recently set up a Onedrive account for myself, so I know the procedure - and it's a fairly easy backend to set up.

rclone authorize onedrive

If your browser doesn't open automatically go to the following link: XXX

Log in and authorize rclone for access

Waiting for code...

Got code

Paste the following into your remote machine


So I authorized OneDrive and then after successful authorization it gave me an access token code for my remote machine, which I'm not sure where to input. I am running a crypt (password enabled) remote so I assume that does make a difference, at least marginally, in the setup process. Thanks and can supply more information if needed.

Oh, it sounds like you are using manual authorization. That is more confusing for new users - are you sure you need that? You typically only need to do that if you work on headless systems that do not have a browser. Otherwise you should just answer "yes" to "use auto config?" then asked during the rclone config process. If you use auto-config then all you should need to do is basically click a button to authorize and the rest is automatic.

But ok, to answer the question directly - if you do coose/need to do it manually you have to open the rclone.conf file
Then find your remote definition. It may look something like this:

[Onedrive]
type = onedrive
client_id = REDACTED
client_secret = REDACTED
token = {"access_token":"REDACTED"}
drive_id = REDACTED
drive_type = business

(certain private info has been REDACTED for my privacy/security, and you should use your own codes anyway)

There you see where the token is supposed to be. Note the format it is in. You should be able to just manually add your token there. Just make sure the format looks right. If you get the token from rclone then it's most likley ready to copy/paste in. And yes... the token on Onedrive is super long before you ask. This is normal :slight_smile:

[myonedrive]

type = crypt

remote = X (numbered but redacted)

filename_encryption = standard

directory_name_encryption = true

password = *** ENCRYPTED ***

password2 = *** ENCRYPTED ***

I don't see a token section, which is what is throwing me off. I'm too new to this to really diagnose the problem as there's a lot of commands and I just don't have the time currently. Thanks much for the help.

You must have misunderstood something I think...
That is a Crypt remote, not a Onedrive remote.
(as you can see from type = crypt )

If you want to use crypt on your onedrive, that is fine - but then you will need to make both and link together.

That setup would look like this in the rclone.conf

[Onedrive]
type = onedrive
client_id = REDACTED
client_secret = REDACTED
token = {"access_token":"REDACTED"}
drive_id = REDACTED
drive_type = business

[OnedriveCrypt]
type = crypt
remote = Onedrive:
filename_encryption = standard
directory_name_encryption = true
password = REDACTED
password2 = REDACTED

Note the highlighted line. This is what links these two together, such that when for example you mount OnedriveCrypt: then the traffic goes like this though the layers:

OSX -> Crypt remote --> OneDrive remote --> Microsoft
(and the other way back in reverse)

In short - you should go into rclone config again and make a Onedrive remote. I guess you already have a crypt remote :wink: If you need more help after that, then just copy both configs here and I will make sure it looks ok (minus the secret parts obviously)

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.