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
This commit is contained in:
Nick Craig-Wood 2025-02-01 12:07:25 +00:00
parent 3daf62cf3d
commit 057fdb3a9d

View File

@ -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,