Post

Configure pCloud OAuth2

Configure pCloud OAuth2

  1. Open the OAuth2 app page: https://docs.pcloud.com/my_apps/
  2. Create a new app. Selection_013.png
  3. Open the settings. Selection_014.png
  4. Configure the redirect URI. Selection_017.png
  5. Create the root folder in my.pcloud.com. Selection_015.png
  6. Copy new folder’s ID from the URL. Selection_018.png

Configure rclone

On a machine with a web browser, install rclone and launch rclone config.

  1. Create a new remote.
    1
    2
    3
    4
    5
    6
    7
    8
    
    e) Edit existing remote
    n) New remote
    d) Delete remote
    r) Rename remote
    c) Copy remote
    s) Set configuration password
    q) Quit config
    e/n/d/r/c/s/q> n
    
  2. Name the new remote.
    1
    
    name> pcloud_backup
    
  3. Select 25 for pCloud storage.
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    
    Type of storage to configure.
    Enter a string value. Press Enter for the default ("").
    Choose a number from below, or type in your own value
     1 / 1Fichier
    \ "fichier"
     2 / Alias for an existing remote
    \ "alias"
     3 / Amazon Drive
    \ "amazon cloud drive"
     4 / Amazon S3 Compliant Storage Provider (AWS, Alibaba, Ceph, Digital Ocean, Dreamhost, IBM COS, Minio, Tencent COS, etc)
    \ "s3"
     5 / Backblaze B2
    \ "b2"
     6 / Box
    \ "box"
     7 / Cache a remote
    \ "cache"
     8 / Citrix Sharefile
    \ "sharefile"
     9 / Dropbox
    \ "dropbox"
    10 / Encrypt/Decrypt a remote
    \ "crypt"
    11 / FTP Connection
    \ "ftp"
    12 / Google Cloud Storage (this is not Google Drive)
    \ "google cloud storage"
    13 / Google Drive
    \ "drive"
    14 / Google Photos
    \ "google photos"
    15 / Hubic
    \ "hubic"
    16 / In memory object storage system.
    \ "memory"
    17 / Jottacloud
    \ "jottacloud"
    18 / Koofr
    \ "koofr"
    19 / Local Disk
    \ "local"
    20 / Mail.ru Cloud
    \ "mailru"
    21 / Microsoft Azure Blob Storage
    \ "azureblob"
    22 / Microsoft OneDrive
    \ "onedrive"
    23 / OpenDrive
    \ "opendrive"
    24 / OpenStack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
    \ "swift"
    25 / Pcloud
    \ "pcloud"
    26 / Put.io
    \ "putio"
    27 / SSH/SFTP Connection
    \ "sftp"
    28 / Sugarsync
    \ "sugarsync"
    29 / Transparently chunk/split large files
    \ "chunker"
    30 / Union merges the contents of several upstream fs
    \ "union"
    31 / Webdav
    \ "webdav"
    32 / Yandex Disk
    \ "yandex"
    33 / http Connection
    \ "http"
    34 / premiumize.me
    \ "premiumizeme"
    35 / seafile
    \ "seafile"
    Storage> 25
    ** See help for pcloud backend at: https://rclone.org/pcloud/ **
    
  4. Copy the client ID of your new pCloud app.
    1
    2
    3
    4
    
    Auth Client Id
    Leave blank normally.
    Enter a string value. Press Enter for the default ("").
    client_id> zQg0smNw8tp
    
  5. Copy the client secret of your new pCloud app.
    1
    2
    3
    4
    
    OAuth Client Secret
    Leave blank normally.
    Enter a string value. Press Enter for the default ("").
    client_secret> 2OSmU2xW6gYaLLCaPPIUg5T5EvX7
    
  6. Edit the advanced settings.
    1
    2
    3
    4
    
    Edit advanced config? (y/n)
    y) Yes
    n) No (default)
    y/n> y
    
  7. Press Enter until you get to the root_folder_id. Copy your folder ID from the pCloud folder which will serve as root for the application.
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    
    OAuth Access Token as a JSON blob.
    Enter a string value. Press Enter for the default ("").
    token> 
    Auth server URL.
    Leave blank to use the provider defaults.
    Enter a string value. Press Enter for the default ("").
    auth_url> 
    Token server url.
    Leave blank to use the provider defaults.
    Enter a string value. Press Enter for the default ("").
    token_url> 
    This sets the encoding for the backend.
    -
    See: the [encoding section in the overview](/overview/#encoding) for more info.
    Enter a encoder.MultiEncoder value. Press Enter for the default ("Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot").
    encoding> 
    Fill in for rclone to use a non root folder as its starting point.
    Enter a string value. Press Enter for the default ("d0").
    root_folder_id> 19066333043
    
  8. Choose your region.
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    
    Hostname to connect to.
    -
    This is normally set when rclone initially does the oauth connection,
    however you will need to set it by hand if you are using remote config
    with rclone authorize.
    -
    Enter a string value. Press Enter for the default ("api.pcloud.com").
    Choose a number from below, or type in your own value
     1 / Original/US region
    \ "api.pcloud.com"
     2 / EU region
    \ "eapi.pcloud.com"
    hostname> 1
    
  9. On the pCloud API, set the redirect URI to http://localhost:53682/.
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    
    Remote config
    Make sure your Redirect URL is set to "http://localhost:53682/" in your custom config.
    Use auto config?
     * Say Y if not sure
     * Say N if you are working on a remote or headless machine
    y) Yes (default)
    n) No
    y/n> 
    If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=-9WXa5fWne_0d-1IQYvwbQ
    Log in and authorize rclone for access
    Waiting for code...
    
  10. Your default browser should open, connect to your account. Selection_019.png

  11. Allow the app to access. Selection_020.png

  12. The redirection should show you a simple success page. Selection_021.png

  13. Close the browser window and return to rclone config.
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    
    Got code
    --------------------
    [pcloud_backup]
    client_id = zQg0smNw8tp
    client_secret = 2OSmU2xW6gYaLLCaPPIUg5T5EvX7
    root_folder_id = 19066333043
    hostname = api.pcloud.com
    token = {"access_token":"AxavZzQg0smNw8tpZcyLMykZYw84XRDMtlJWkrQrRiMBc8V9dJc7","token_type":"bearer","expiry":"0001-01-01T00:00:00Z"}
    --------------------
    y) Yes this is OK (default)
    e) Edit this remote
    d) Delete this remote
    y/e/d> y
    

Verify your settings in pCloud

  1. Open pCloud “Settings -> Linked Accounts”. https://my.pcloud.com/#page=settings&settings=tab-apps

  2. In the Linked Apps section you will find your application and you can see it’s limited to a specific folder. Selection_022.png

References

This post is licensed under CC BY 4.0 by the author.

Comments powered by Disqus.