How does ondrive and MFA work with rclone?


I'd like to understand how rclone will work with onedrive. The docs say that during the initial config, a token will be retrieved and that will require manual intervention, especially if 2FA is involved. But what about subsequent runs of rclone? I guess the refresh token will expire at some point if I don't use rclone for a while. Will I be able to use rclone in a fully unattended way or will I need to manually authenticate for onedrive from times to times?

Run the command 'rclone version' and share the full output of the command.

I don't have rclone yet

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


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

None yet

The rclone config contents with secrets removed.


A log from the command with the -vv flag


2FA or whatever authentication is on your Microsoft account is only required once to generate token. Then token refreshes itself automatically.

On top of my head for onedrive token has to be refreshed before 90 days - meaning if you stop using rclone for 90 days you will have to re-authenticate. If you use it regularly it will work forever.

Thank you. This is exactly the kind of answer I was looking for. Very helpful.

1 Like

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