mirror of
https://github.com/rclone/rclone.git
synced 2025-01-11 00:40:03 +01:00
gcs: Don't configure the oauth token if service_account_file is supplied
This commit is contained in:
parent
022ab4516d
commit
3a1198cac5
@ -160,21 +160,10 @@ creating an account, a JSON file containing the Service Account's
|
||||
credentials will be downloaded onto your machines. These credentials
|
||||
are what rclone will use for authentication.
|
||||
|
||||
To use a Service Account instead of OAuth2 token flow, replace the
|
||||
`token` section of your `.rclone.conf` with a `service_account_file`
|
||||
pointing to the JSON credentials.
|
||||
|
||||
For example, here's an example `.rclone.conf` that sets up read only
|
||||
access using a service account:
|
||||
|
||||
```
|
||||
[readonly-sync]
|
||||
type = google cloud storage
|
||||
project_number = 123456789
|
||||
service_account_file = $HOME/.rclone-service_account.json
|
||||
object_acl = authenticatedRead
|
||||
bucket_acl = authenticatedRead
|
||||
```
|
||||
To use a Service Account instead of OAuth2 token flow, enter the path
|
||||
to your Service Account credentials at the `service_account_file`
|
||||
prompt and rclone won't use the browser based authentication
|
||||
flow.
|
||||
|
||||
### Modified time ###
|
||||
|
||||
|
@ -62,6 +62,9 @@ func init() {
|
||||
Description: "Google Cloud Storage (this is not Google Drive)",
|
||||
NewFs: NewFs,
|
||||
Config: func(name string) {
|
||||
if fs.ConfigFile.MustValue(name, "service_account_file") != "" {
|
||||
return
|
||||
}
|
||||
err := oauthutil.Config("google cloud storage", name, storageConfig)
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to configure token: %v", err)
|
||||
|
Loading…
Reference in New Issue
Block a user