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

QuestionableQuesting/Xenforo 2 Factor Authentication #701

Open
TheAkashicTraveller opened this issue May 28, 2021 · 7 comments
Open

QuestionableQuesting/Xenforo 2 Factor Authentication #701

TheAkashicTraveller opened this issue May 28, 2021 · 7 comments

Comments

@TheAkashicTraveller
Copy link

Could we get support for 2FA on zenforo logins? As it is I can't download stories from QQ without having to disable 2FA.

@JimmXinu JimmXinu changed the title QuestionableQuesting/Zenforo 2 Factor Authentication QuestionableQuesting/Xenforo 2 Factor Authentication May 28, 2021
@JimmXinu
Copy link
Owner

If somebody knows how to do that in Python, I'd be interested it hear about it.

@jcotton42
Copy link
Contributor

As an alternative the browser cache feature could be enabled for Xenforo, I just did this for Patreon for the exact reason of not needing to deal with 2FA.

@TheAkashicTraveller do you have any example stories I could use to test with? I'd be willing to look into enabling browser cache for this site.

@TheAkashicTraveller
Copy link
Author

@jcotton42 Do you need any particular story? If not here's one.

@JimmXinu
Copy link
Owner

base_xenforoforum_adapter / base_xenforo2forum_adapter is probably the most complex downloader in FFF.

For just one example, it's common to need several, sometimes 10s, of network requests to get all the threadmarks because there are multiple threadmark lists and the site only loads partial lists and you have to click a '...' link to see more--usually in the middle.

So for browser cache, the user would need to open all the threadmark lists and make sure all of the entries had been viewed. (And as I recall, the site did not hide the same parts of the list when viewed in browser vs in FFF. Not sure what impact that might have.)

Also, XF sites use post URLs that get redirected to URLs of form thread/page#post. The #post part (the anchor) is not part of the URL as far as the caching system is concerned.

I'm not saying it's impossible, but it would need a great deal of testing and a huge amount of clicking. Dealing with 2FA directly might be easier.

@TheAkashicTraveller
Copy link
Author

TheAkashicTraveller commented Nov 19, 2021

I guess it depends on how the adapter put's in the password normally. On the QQ end you log in like normal and then it takes you to a new page where it asks for the 2fa code, it goes to this url: https://forum.questionablequesting.com/login/two-step?redirect=https%3A%2F%2Fforum.questionablequesting.com%2F&remember=0
QQ2fa

@jcotton42
Copy link
Contributor

Ah, I hadn't realized just how complicated the adapter is, supporting 2FA directly may very well be simpler.

Is there some way for an adapter to ask the user for input during the metadata gathering process?

@JimmXinu
Copy link
Owner

Currently, an adapter can raise FailedToLogin and AdultCheckRequired exceptions, which cli.py and fff_plugin.py catch and then prompt the user for user/pass or 'yes, adult'.

But only when running interactively. CLI can run with --non-interactive Calibre plugin has the 'Background Metadata' option.

A third exception could be added for collecting a two factor code. The adapter would have to recognize the two factor code and skip the user/pass login part.

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

3 participants