Box Enterprise App, no refresh token?

What is the problem you are having with rclone?

Trying to figure out the best way to use RCLONE without having to generate an access token via the web auth. This is fairly easy to solve using the Server Authentication Box app, and using the enterprise subject type, and grant+type "client_credentials".

This makes everything pretty easy... No refresh tokens, just run a basic curl command: (This is in powershell)

$body = @{
    client_id = "XXX"
    client_secret = "YYY"
    box_subject_id = "ZZZ"
    box_subject_type = "enterprise"
    grant_type = "client_credentials"
}

$response = Invoke-RestMethod -Uri "https://api.box.com/oauth2/token" `
    -Method POST `
    -ContentType "application/x-www-form-urlencoded" `
    -Body $body

And dump the access token JSON into the box config file as:

token = $response | ConvertTo-Json -Compress

On the initial run, everything works fine. However since there is no refresh token, the box process either needs this re-added or to go through the auth process that requires manual intervention through the web interface. I am curious if anyone has any recommendations for this (Specifically trying to use rclone mount), not requiring to authenticate through a browser, and to have rclone perpetuate the connection.

I found some articles with JWT and OAUTH tokens, but I couldnt get them to work without having to authenticate through the web browser.

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

rclone --version
rclone v1.70.2
- os/version: Microsoft Windows Server 2022 Standard 21H2 21H2 (64 bit)
- os/kernel: 10.0.20348.3807 (x86_64)
- os/type: windows
- os/arch: amd64
- go/version: go1.24.4
- go/linking: static
- go/tags: cmount

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

Box

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

rclone mount box-test:Test C:\BoxTest --links --vfs-cache-mode off

Note - This works just fine... it's what happens after an hour, and getting 401 Auth errors once the access token expires.

Please run 'rclone config redacted' and share the full output. If you get command not found, please make sure to update rclone.

[box-test]
type = box
client_secret = XXX
client_id = XXX
box_sub_type = enterprise
box_subject_id = XXX
token = XXX
### Double check the config for sensitive info before posting publicly

A log from the command that you were trying to run with the -vv flag

I have a test going currently... since I have to wait an hour, I will post this when I can.

I believe this is your relevant issue:

Box will not refresh OAuth2 with JWT · Issue #7214 · rclone/rclone