Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't connect pCloud account protected by 2FA #4210

Open
danielrosehill opened this issue May 8, 2020 · 27 comments
Open

Can't connect pCloud account protected by 2FA #4210

danielrosehill opened this issue May 8, 2020 · 27 comments

Comments

@danielrosehill
Copy link

danielrosehill commented May 8, 2020

What is the problem you are having with rclone?

When trying to add a pCloud account as a remote, the browser prompt from pCloud automatically states:

"Two factor authentication required"

2FA

There is no way to create the integration while maintaining 2FA on pCloud.

What is your rclone version (output from rclone version)

v150.2

Which OS you are using and how many bits (eg Windows 7, 64 bit)

Ubuntu 20.04

Which cloud storage system are you using? (eg Google Drive)

pCloud (attempted)

The command you were trying to run (eg rclone copy /tmp remote:tmp)

Trying to add pCloud to sync with another cloud

A log from the command with the -vv flag (eg output from rclone -vv copy /tmp remote:tmp)

N/A

@ncw
Copy link
Member

ncw commented May 9, 2020

Is this because you have 2FA activated on your account?

I can't find any mention of how to use 2FA with the API in their docs. Can you ask pCloud support and see what they say?

@Sunil-P you were working on the pcloud backend recently - do you have any ideas about this?

@ncw ncw added this to the Help Wanted milestone May 9, 2020
@Sunil-P
Copy link
Contributor

Sunil-P commented May 9, 2020

I did not face the issue described above, maybe because I didn't enable 2FA. Let me test out with 2FA enabled. If we are to implement 2FA support, we would need more info.

@garret
Copy link

garret commented May 9, 2020

I am also interested as I have 2fa activated on pCloud. I wonder how this has not come up before as I was expecting most people having that activated by default.

@danielrosehill
Copy link
Author

@ncw Yes, I have 2FA enabled on my pCloud and most accounts!

I reached out to pCloud support on Twitter and by email. Heard back on the former channel:

Twitter_exchange

@danielrosehill
Copy link
Author

@Sunil-P Yes. This behavior only occurs when trying to connect rlcone to a pCloud account with 2FA enabled. However, in light of the fact that using 2FA is strongly advised, particularly when securing cloud file storage, I think that it would be a good issue to address. In the meantime, I am using an awkward workaround to sync pCloud with my intended destination (Backblaze B2).

@ncw
Copy link
Member

ncw commented May 11, 2020

@danielrosehilljlm

Thanks for reaching out to their support.

In the meantime, I am using an awkward workaround to sync pCloud with my intended destination (Backblaze B2).

Can you describe your work-around for others who come across this issue?

@danielrosehill
Copy link
Author

@danielrosehilljlm

Thanks for reaching out to their support.

In the meantime, I am using an awkward workaround to sync pCloud with my intended destination (Backblaze B2).

Can you describe your work-around for others who come across this issue?

Happily. Although I think that calling it a workaround is being too kind to myself.

I just bundled my pCloud together into an archive, downloaded that on an EC2 instance, and then pushed it up to B2 (so effectively a local --> remote from a cloud server).

Documented here:
https://github.com/danielrosehilljlm/Master_Backup_Strategy/blob/master/documentation/pCloud%20to%20B2%20over%20EC2.md

@KRossKoWolf
Copy link

KRossKoWolf commented May 16, 2020

I had this issue also, but managed to resolve it by signing into pcloud on the browser first with login & 2FA, then doing rclone authorize "pcloud". This then showed a page allowing me to authorize, then the Success page. Then in the terminal I was given a token, which I entered on my headless box, and it's all working now.

@danielrosehill
Copy link
Author

@KRossKoWolf Tried your approach but got this:

@gregology
Copy link

@KRossKoWolf Tried your approach but got this:

I'm also having this issue on Mac

rclone v1.51.0
- os/arch: darwin/amd64
- go version: go1.13.7

@creativeprojects
Copy link
Collaborator

creativeprojects commented May 21, 2020

I tried to connect to pCloud from rclone on Mac OS tonight and I got the same message: This 'redirect_uri' is not autorized. I think something has changed in their API very recently.
(I have not enabled 2FA on pCloud)

@afuetterer
Copy link

I am facing this issue as well. I tried to setup my pcloud remote in a virtual machine first.

rclone v1.51.0
- os/arch: linux/amd64
- go version: go1.14.2

When trying to authorize rclone with pcloud, I get a redirect error. I am able to login succesfully, but the redirect is the problem I guess?
So effectively I cannot setup my pcloud remote on a second machine at the moment using 2FA.

ncw added a commit that referenced this issue May 25, 2020
pCloud should be passing back the state parameter that rclone passed
in on config but it seems to have got lost somewhere.

This sets a work-around for the pCloud backend allowing an empty state
parameter.

See: https://forum.rclone.org/t/cannot-connect-to-pcloud/16592
See: https://forum.rclone.org/t/cannot-create-pcloud-config-file-on-osx/16583
@ncw
Copy link
Member

ncw commented May 25, 2020

@creativeprojects can you see what it is trying to redirect to?

If I try making a new pcloud remote on linux (also without 2FA) I get this

Error: Auth state doesn't match

Description: Expecting "UNs6tzVmjoz85Ou7qBbpDw" got ""

So pcloud has lost the state we sent it somewhere along the line.

The error on macOS is different and I don't understand why!

Can you all have a go with this which attempts to work-around the problem?

https://beta.rclone.org/branch/v1.51.0-369-g4599e484-fix-4210-pcloud-oauth-beta/ (uploaded in 15-30 mins)

@creativeprojects
Copy link
Collaborator

Can you all have a go with this which attempts to work-around the problem?

https://beta.rclone.org/branch/v1.51.0-369-g4599e484-fix-4210-pcloud-oauth-beta/ (uploaded in 15-30 mins)

Yes! it worked for me. It asked for my password twice, but it could just be fat fingers typing... I'll try on the other mac to make sure 👍

@afuetterer
Copy link

I tried it with v1.51.0-369-g4599e484-fix-4210-pcloud-oauth-beta as well. When I enter my credentials and a 2FA code to create a new pcloud remote I get redirected to
https://undefined/oauth2/authorize?client_id=XXXXXXXXXXXXXX&response_type=code&redirect_uri=http://localhost:53682/&auth=XXXXXXXXXXXXXX. I changed the tokens to Xs.
Firefox gives me "Hmm. We’re having trouble finding that site. We can’t connect to the server at undefined."
rclone then waits forever for a token.
Maybe this is another issue after all?

Some part of the URL is not constructed properly I guess?

ncw added a commit that referenced this issue May 26, 2020
pCloud should be passing back the state parameter that rclone passed
in on config but it seems to have got lost somewhere.

This sets a work-around for the pCloud backend allowing an empty state
parameter.

See: https://forum.rclone.org/t/cannot-connect-to-pcloud/16592
See: https://forum.rclone.org/t/cannot-create-pcloud-config-file-on-osx/16583
@ncw
Copy link
Member

ncw commented May 26, 2020

I've merged the fix for the Failed to configure token: Error: Auth state doesn't match problem to master now which means it will be in the latest beta in 15-30 mins and released in v1.52

This means that you should be able to auth to pCloud without 2FA.

@creativeprojects do you fancy having a look at what is needed to make the 2FA part of it work?

@creativeprojects
Copy link
Collaborator

do you fancy having a look at what is needed to make the 2FA part of it work?

Yes I can have a look at it (pretty busy these days but I should be able to give it some time)

@creativeprojects
Copy link
Collaborator

oh BTW I tried the latest beta, and I can confirm it does ask me for my password twice. It's like the first request is cancelled or something. Weird

@ncw
Copy link
Member

ncw commented May 26, 2020

oh BTW I tried the latest beta, and I can confirm it does ask me for my password twice. It's like the first request is cancelled or something. Weird

I was assuming that was something to do with the pcloud website - does rclone get involved between the two password entries?

@danielrosehill
Copy link
Author

danielrosehill commented May 28, 2020

@creativeprojects can you see what it is trying to redirect to?

If I try making a new pcloud remote on linux (also without 2FA) I get this

Error: Auth state doesn't match

Description: Expecting "UNs6tzVmjoz85Ou7qBbpDw" got ""

So pcloud has lost the state we sent it somewhere along the line.

The error on macOS is different and I don't understand why!

Can you all have a go with this which attempts to work-around the problem?

https://beta.rclone.org/branch/v1.51.0-369-g4599e484-fix-4210-pcloud-oauth-beta/ (uploaded in 15-30 mins)

Installed the Beta package but now get this error when trying to allow the integration and after executing rclone authorize "pcloud"

@ncw
Copy link
Member

ncw commented May 31, 2020

Installed the Beta package but now get this error when trying to allow the integration and after executing rclone authorize "pcloud"

Do you have 2FA turned on? Try turning it off while you connect rclone.

@danielrosehill
Copy link
Author

Installed the Beta package but now get this error when trying to allow the integration and after executing rclone authorize "pcloud"

Do you have 2FA turned on? Try turning it off while you connect rclone.

Yes, I do use 2FA. I will try that workaround later, but this is kind of what I have been trying to avoid: I'm logged in to pCloud from about six devices, and toggling 2FA involves not only reauthenticating from each machine but also having to download a fresh batch of backup codes.

@ncw
Copy link
Member

ncw commented Jun 4, 2020

I think this is maybe a bug at pCloud... I tried disabling "implicit grant" to make the app more secure but that didn't help. In the mean time I've emailed pCloud support to ask them what is going on.

@ncw
Copy link
Member

ncw commented Jun 5, 2020

I received this email from pCloud support

Thanks for your e-mail.

Unfortunately, most of the 3rd party apps/software do not work with 2FA enabled. The developers are aware of the issue but we still do not have a workaround.

If you have any additional questions, please don't hesitate to ask.

So it looks like we have to wait for pCloud to fix the problem here.

@danielrosehill
Copy link
Author

I think this is maybe a bug at pCloud... I tried disabling "implicit grant" to make the app more secure but that didn't help. In the mean time I've emailed pCloud support to ask them what is going on.

Thanks.

To be honest, I only use pCloud because their Linux Desktop is the best cloud storage sync I've found for the platform so far. The performance is much smoother than mounting Google Drive. But maybe it's time to switch: I love rclone and think it is very important to regularly backup all cloud storage!

@royoky
Copy link

royoky commented Nov 12, 2020

I received this email from pCloud support

Thanks for your e-mail.
Unfortunately, most of the 3rd party apps/software do not work with 2FA enabled. The developers are aware of the issue but we still do not have a workaround.
If you have any additional questions, please don't hesitate to ask.

So it looks like we have to wait for pCloud to fix the problem here.

The issue seems to have been finally fixed by pCloud:

image

I successfully managed to login to my account with 2FA activated.

@alensiljak
Copy link
Contributor

As per linked issue, I've only now tried this and it works in Keepass2Android (registered pCloud app/plugin), pCloud Android app, RCX on Android, rclone in Termux Alpine distro and rclone in Termux.
🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests