Expiry Date just for 1 hour

What is the problem you are having with rclone?

my one drive -share point site take just one hour for the token despite i tried all solutions from other question for same issue , i make also all the steps for creating our own CLIENT_ID , SECRET_ID (24 month)
any help please .

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

rclone v1.61.1

  • os/version: darwin 13.1 (64 bit)
  • os/kernel: 22.2.0 (arm64)
  • os/type: darwin
  • os/arch: arm64
  • go/version: go1.19.4
  • go/linking: dynamic
  • go/tags: cmount

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

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

rclone config (creating new remote)/ rclone config reconnect remote: / rclone config update remote: --all

The rclone config contents with secrets removed.

type = onedrive
client_id = 2d976---CLIENT_ID
client_secret = vZd8Q---SECRET
token = {"access_token":"eyJ0eXA-----token---mA9X9mc","expiry":"2023-01-15T13:29:44.046009+02:00"}
drive_id = b!1oH0IyWJsEqT8y0ni7fxe6eOZFGFRDFJ
drive_type = documentLibrary

A log from the command with the -vv flag

rclone -vv config reconnect REMOTE:
2023/01/15 12:16:16 DEBUG : rclone: Version "v1.61.1" starting with parameters ["rclone" "-vv" "config" "reconnect" "REMOTE:"]
2023/01/15 12:16:16 DEBUG : Using config file from "/Users/mr.simple/.config/rclone/rclone.conf"
2023/01/15 12:16:16 DEBUG : REMOTE: config in: state="", result=""
2023/01/15 12:16:16 DEBUG : REMOTE: config out: out=&{State:*oauth,choose_type,, Option:<nil> OAuth:<nil> Error: Result:}, err=<nil>
2023/01/15 12:16:16 DEBUG : REMOTE: config in: state="*oauth,choose_type,,", result=""
2023/01/15 12:16:16 DEBUG : REMOTE: config out: out=&{State:*oauth-confirm,choose_type,, Option:true OAuth:<nil> Error: Result:}, err=<nil>
2023/01/15 12:16:16 DEBUG : REMOTE: config: reading config parameter "config_refresh_token"
Already have a token - refresh?
y) Yes (default)
n) No
y/n>

2023/01/15 12:16:37 DEBUG : REMOTE: config in: state="*oauth-confirm,choose_type,,", result="true"
2023/01/15 12:16:37 DEBUG : REMOTE: config out: out=&{State:*oauth-islocal,choose_type,, Option:true OAuth:<nil> Error: Result:}, err=<nil>
2023/01/15 12:16:37 DEBUG : REMOTE: config: reading config parameter "config_is_local"
Use web browser to automatically authenticate rclone with remote?
 * Say Y if the machine running rclone has a web browser you can use
 * Say N if running rclone on a (remote) machine without web browser access
If not sure try Y. If Y failed, try N.

y) Yes (default)
n) No
y/n>

2023/01/15 12:16:41 DEBUG : REMOTE: config in: state="*oauth-islocal,choose_type,,", result="true"
2023/01/15 12:16:41 DEBUG : REMOTE: config out: out=&{State:*oauth-do,choose_type,, Option:<nil> OAuth:<nil> Error: Result:}, err=<nil>
2023/01/15 12:16:41 DEBUG : REMOTE: config in: state="*oauth-do,choose_type,,", result=""
2023/01/15 12:16:41 NOTICE: Make sure your Redirect URL is set to "http://localhost:53682/" in your custom config.
2023/01/15 12:16:41 DEBUG : Starting auth server on 127.0.0.1:53682
2023/01/15 12:16:41 NOTICE: If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=9StOkbl4z7j9D3XTcZvSSA
2023/01/15 12:16:41 NOTICE: Log in and authorize rclone for access
2023/01/15 12:16:41 NOTICE: Waiting for code...
2023/01/15 12:16:41 DEBUG : Redirecting browser to: https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize?access_type=offline&client_id=247187dd&redirect_uri=http%3A%2F%2Flocalhost%3A53682%2F&response_type=code&scope=Files.Read+Files.ReadWrite+Files.Read.All+Files.ReadWrite.All+Sites.Read.All+offline_access&state=9StOkbl4z7j9D3XTcZvSSA
2023/01/15 12:16:42 DEBUG : Received GET request on auth server to "/"
2023/01/15 12:16:42 NOTICE: Got code
2023/01/15 12:16:42 DEBUG : Closing auth server
2023/01/15 12:16:42 DEBUG : Closed auth server with error: accept tcp 127.0.0.1:53682: use of closed network connection
2023/01/15 12:16:42 DEBUG : Saving config "token" in section "REMOTE" of the config file
2023/01/15 12:16:42 DEBUG : REMOTE: Saved new token in config file
2023/01/15 12:16:42 DEBUG : REMOTE: config out: out=&{State:*oauth-done,choose_type,, Option:<nil> OAuth:<nil> Error: Result:}, err=<nil>
2023/01/15 12:16:42 DEBUG : REMOTE: config in: state="*oauth-done,choose_type,,", result=""
2023/01/15 12:16:42 DEBUG : REMOTE: config out: out=&{State:choose_type Option:<nil> OAuth:<nil> Error: Result:}, err=<nil>
2023/01/15 12:16:42 DEBUG : REMOTE: config in: state="choose_type", result=""
2023/01/15 12:16:42 DEBUG : REMOTE: config out: out=&{State:choose_type_done Option:onedrive OAuth:<nil> Error: Result:}, err=<nil>
2023/01/15 12:16:42 DEBUG : REMOTE: config: reading config parameter "config_type"
Option config_type.
Type of connection
Choose a number from below, or type in an existing string value.
Press Enter for the default (onedrive).
 1 / OneDrive Personal or Business
   \ (onedrive)
 2 / Root Sharepoint site
   \ (sharepoint)
   / Sharepoint site name or URL
 3 | E.g. mysite or https://contoso.sharepoint.com/sites/mysite
   \ (url)
 4 / Search for a Sharepoint site
   \ (search)
 5 / Type in driveID (advanced)
   \ (driveid)
 6 / Type in SiteID (advanced)
   \ (siteid)
   / Sharepoint server-relative path (advanced)
 7 | E.g. /teams/hr
   \ (path)
config_type> 3

2023/01/15 12:16:51 DEBUG : REMOTE: config in: state="choose_type_done", result="url"
2023/01/15 12:16:51 DEBUG : REMOTE: config out: out=&{State:url Option:<nil> OAuth:<nil> Error: Result:}, err=<nil>
2023/01/15 12:16:51 DEBUG : REMOTE: config in: state="url", result=""
2023/01/15 12:16:51 DEBUG : REMOTE: config out: out=&{State:url_end Option: OAuth:<nil> Error: Result:}, err=<nil>
2023/01/15 12:16:51 DEBUG : REMOTE: config: reading config parameter "config_site_url"
Option config_site_url.
Site URL
Example: "https://contoso.sharepoint.com/sites/mysite" or "mysite"
Enter a value.
config_site_url> https://SITE.sharepoint.com/sites/mysite/

2023/01/15 12:17:08 DEBUG : REMOTE: config in: state="url_end", result="https://SITE.sharepoint.com/sites/mysite/"
2023/01/15 12:17:10 DEBUG : REMOTE: config out: out=&{State:driveid_final Option:b!1oH0IyWJsEqT8y0ni7fxe6eOZFGFRDFJtVY8IvVMmZ3rmKI2Nz4OQ4oe-RCs8y0K OAuth:<nil> Error: Result:}, err=<nil>
2023/01/15 12:17:10 DEBUG : REMOTE: config: reading config parameter "config_driveid"
Option config_driveid.
Select drive you want to use
Choose a number from below, or type in your own string value.
Press Enter for the default (b!1oH0IyWJsEqT8y0ni7fxe6eOZFGFRDFJtVY8IvVMmZ3rmKI2Nz4OQ4oe-RCs8y0K).
 1 / Documents (documentLibrary)
   \ (b!1oH0IyWJsEqT8y0ni7fxe6eOZFGFRDFJtVY8IvVMmZ3rmKI2Nz4OQ4oe-RCs8y0K)
config_driveid> 1

2023/01/15 12:17:13 DEBUG : SITE: config in: state="driveid_final", result="b!1oH0IyWJsEqT8y0ni7fxe6eOZFGFRDFJtVY8IvVMmZ3rmKI2Nz4OQ4oe-RCs8y0K"
2023/01/15 12:17:14 DEBUG : Saving config "drive_id" in section "SITE" of the config file
2023/01/15 12:17:14 DEBUG : Saving config "drive_type" in section "SITE" of the config file
2023/01/15 12:17:14 DEBUG : REMOTE: config out: out=&{State:driveid_final_end Option:true OAuth:<nil> Error: Result:}, err=<nil>
2023/01/15 12:17:14 DEBUG : REMOTE: config: reading config parameter "config_drive_ok"
Drive OK?

Found drive "root" of type "documentLibrary"
URL: https://SITE.sharepoint.com/sites/mysite

y) Yes (default)
n) No
y/n>

2023/01/15 12:17:16 DEBUG : REMOTE: config in: state="driveid_final_end", result="true"
2023/01/15 12:17:16 DEBUG : REMOTE: config out: out=<nil>, err=<nil>
2023/01/15 12:17:16 DEBUG : rclone: Version "v1.61.1" finishing with parameters ["rclone" "-vv" "config" "reconnect" "REMOTE:"]

Hi munged,

It usually makes no difference whether you use rclone's Client ID or your own Client ID with OneDrive, so I suggest you try creating a new remote, where you leave the Client ID and Client Secret empty/blank.

If this doesn't help then check that all users executing rclone as write access to rclone.conf and the folder it is placed in. This is needed to store refreshed tokens. You can find the file location with rclone config file.

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