From b1d43f8d41d99a9a1927f03975d5087d8d555c76 Mon Sep 17 00:00:00 2001 From: albertony <12441419+albertony@users.noreply.github.com> Date: Fri, 22 Apr 2022 13:52:00 +0200 Subject: [PATCH] jottacloud: fix scope in token request The existing code in rclone set the value "offline_access+openid", when encoded in body it will become "offline_access%2Bopenid". I think this is wrong. Probably an artifact of "double urlencoding" mixup - either in rclone or in the jottacloud cli tool version it was sniffed from? It does work, though. The token received will have scopes "email offline_access" in it, and the same is true if I change to only sending "offline_access" as scope. If a proper space delimited list of "offline_access openid" is used in the request, the response also includes openid scope: "openid email offline_access". I think this is more correct and this patch implements this. See: #6107 --- backend/jottacloud/jottacloud.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/jottacloud/jottacloud.go b/backend/jottacloud/jottacloud.go index 3141d22da..96a6583f5 100644 --- a/backend/jottacloud/jottacloud.go +++ b/backend/jottacloud/jottacloud.go @@ -519,7 +519,7 @@ func doTokenAuth(ctx context.Context, apiSrv *rest.Client, loginTokenBase64 stri values.Set("client_id", defaultClientID) values.Set("grant_type", "password") values.Set("password", loginToken.AuthToken) - values.Set("scope", "offline_access+openid") + values.Set("scope", "openid offline_access") values.Set("username", loginToken.Username) values.Encode() opts = rest.Opts{