From 057fdb3a9d81940155b47823c19c5d0657d4be37 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sat, 1 Feb 2025 12:07:25 +0000 Subject: [PATCH] lib/oauthutil: fix redirect URL mismatch errors - fixes #8351 In this commit we introduced support for client credentials flow: 65012beea4b93b7f lib/oauthutil: add support for OAuth client credential flow This involved re-organising the oauth credentials. Unfortunately a small error was made which used a fixed redirect URL rather than the one configured for the backend. This caused the box backend oauth flow not to work properly with redirect_uri_mismatch errors. These backends were using the wrong redirect URL and will likely be affected, though it is possible the backends have workarounds. - box - drive - googlecloudstorage - googlephotos - hidrive - pikpak - premiumizeme - sharefile - yandex --- lib/oauthutil/oauthutil.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/oauthutil/oauthutil.go b/lib/oauthutil/oauthutil.go index a03fd592d..e2cbc8837 100644 --- a/lib/oauthutil/oauthutil.go +++ b/lib/oauthutil/oauthutil.go @@ -108,7 +108,7 @@ func (conf *Config) MakeOauth2Config() *oauth2.Config { return &oauth2.Config{ ClientID: conf.ClientID, ClientSecret: conf.ClientSecret, - RedirectURL: RedirectLocalhostURL, + RedirectURL: conf.RedirectURL, Scopes: conf.Scopes, Endpoint: oauth2.Endpoint{ AuthURL: conf.AuthURL,