oauth: Allow auth_url and token_url to be set in the config file
If set in the config file, these override the ones configured into the remote. This enables alternative oauth servers to be used for all oauth remotes. This can only be altered by editing the config file for the moment.
This commit is contained in:
parent
9c1e703777
commit
52e1bfae2a
2 changed files with 16 additions and 0 deletions
|
@ -209,6 +209,16 @@ func overrideCredentials(name string, origConfig *oauth2.Config) (config *oauth2
|
|||
config.ClientSecret = ClientSecret
|
||||
changed = true
|
||||
}
|
||||
AuthURL := fs.ConfigFileGet(name, fs.ConfigAuthURL)
|
||||
if AuthURL != "" {
|
||||
config.Endpoint.AuthURL = AuthURL
|
||||
changed = true
|
||||
}
|
||||
TokenURL := fs.ConfigFileGet(name, fs.ConfigTokenURL)
|
||||
if TokenURL != "" {
|
||||
config.Endpoint.TokenURL = TokenURL
|
||||
changed = true
|
||||
}
|
||||
return config, changed
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue