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

Add Support for 2FA #25

Open
krazyjakee opened this issue Sep 10, 2020 · 9 comments
Open

Add Support for 2FA #25

krazyjakee opened this issue Sep 10, 2020 · 9 comments

Comments

@krazyjakee
Copy link

I would like to suggest that support for 2FA be added to the roadmap.
That way the account can keep that layer of security while using this tool.

Thank you

@ncw
Copy link
Collaborator

ncw commented Sep 12, 2020

Would you like to send a pull request for this?

@krazyjakee
Copy link
Author

krazyjakee commented Sep 12, 2020

I'm just an rclone user and never touched golang but happy to help find a way to approach. You seem to already have this feature in your sites according to this line: https://github.com/t3rm1n4l/go-mega/blob/master/messages.go#L21

I'm not sure what api you are using as I can't find any documentation for a mega rest api. The C++ SDK includes a multiFactorAuthLogin function.

MegaCMD has an undocumented auth-code flag.

If the Mega rest API doesn't support mfa (2fa) then you will have to fundamentally change how this library communicates with MEGA to achieve this feature.

@trulyliu
Copy link

Any progress on this feature request?

@neggles
Copy link

neggles commented Aug 14, 2021

#34 seems like a pretty solid fix for this, though I'm not sure the extra 'MultiFactorLogin' is required when regular login supports it as well (and I'm not really a Go person so I'm not sure if the semantics are right for this to be non-breaking)

@DarkFighterLuke
Copy link
Contributor

DarkFighterLuke commented Aug 14, 2021

#34 seems like a pretty solid fix for this, though I'm not sure the extra 'MultiFactorLogin' is required when regular login supports it as well (and I'm not really a Go person so I'm not sure if the semantics are right for this to be non-breaking)

Thank you for the "a pretty solid fix", I really appreciate it.
About the extra function, it is defined as a function separated by the "classic" login method to follow the Mega SDK structure. In this way, a user can be easily traced back to the MegaApi documentation.
I find it a better solution rather than keeping all in a single login function with arguments that a user could not be using and therefore it would be obliged to pass an OTP code parameter which is empty. So basically I find it cleaner.

A note apart from the rest: sadly I think that this library is dead, I haven't seen active maintainers for a while and pull requests are left unreviewed.

@neggles
Copy link

neggles commented Aug 15, 2021

Ah, OK, that makes sense - I'd probably leave the main login() method/func alone, then, and just add the extra one; from my understanding of how Go works, wouldn't changing the args of login() break all existing calls to the function? Probably better to have that discussion on the PR 😝 edit: wait, i'm dumb, login() is internal only so it's fine and that's exactly the right way to do it

I agree that this repo seems to be abandoned, or at least very very inactive, which is inconvenient. rclone uses this library to talk to Mega, so rclone can't handle Mega MFA, which is how I ended up here - hoping the library had support and rclone just needed to implement it...

It would be relatively simple to fork the repo and add support - I might do that (and fork rclone) just for my own personal use - but I'm not super comfortable volunteering to maintain the fork long-term when I've never really used Go before, and I'm not sure how willing to change forks the rclone devs would be, anyway 😕

@bingoxo
Copy link

bingoxo commented Apr 2, 2024

@neggles did you manage to get it to work :) ?

@neggles
Copy link

neggles commented Apr 15, 2024

@bingoxo 'fraid not, I just gave up and used megacmd :(

@bingoxo
Copy link

bingoxo commented Apr 17, 2024

@bingoxo 'fraid not, I just gave up and used megacmd :(

@neggles do you mind taking a look at it again please ? , rclone is using this library for mega and it still doesn't have 2fa support

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

No branches or pull requests

7 participants
@ncw @krazyjakee @trulyliu @neggles @DarkFighterLuke @bingoxo and others