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

Support for websites with login page in two steps #326

Open
Merinorus opened this issue May 18, 2023 · 2 comments
Open

Support for websites with login page in two steps #326

Merinorus opened this issue May 18, 2023 · 2 comments

Comments

@Merinorus
Copy link

Hello,

I'm trying to make a site config for the website https://elucid.media/.
So far I have written this custom config elucid.media.txt:

title: //h1[contains(@class, 'single-title')]
body: //section[contains(@id, 'article-content')]
author: substring-after(//a[contains(@class, 'article-meta_author')], 'Par ')

# wallabag-specific login directives (not supported in FTR)
requires_login: yes
login_uri: https://compte.elucid.media/elucid/connexion/password
login_username_field: email
login_password_field: password

not_logged_in_xpath: //a[contains(@class, 'call-to-subscribe-content_button')]|//button[text()[contains(.,"S'identifier")]]|//a[contains(@href, 'compte.elucid.media/elucid/connexion')]

test_url: https://elucid.media/environnement/transition-energetique-la-chimere-de-l-hydrogene-vert/

The problem with this website is that the login page is in two steps, contrary to all the other websites I saw:

  1. https://compte.elucid.media/elucid/connexion: asks for email address only, then click on "Continue",
  2. https://compte.elucid.media/elucid/connexion/password: asks for password only (email field is already filled and greyed out), then click on "Login".

I tried to put the second URL directly in the config since the second URL would automatically return to the first one.
It could use sort of a loop :

  1. Detect that the user is not logged
  2. Go to the login URL, the website redirects to URL n°1, enter your email address (the password field is absent)
  3. Redirect to the article
  4. Detect again that the user is not logged
  5. Go again to the login URL, the website doesn't redirect since the email address is already filled (probably stored in the user session, I didn't check), now Graby can enter the password
  6. Should be logged now.

Unfortunately, I guess this behavior needs some rework on the code and the website config file is not enough to handle this particular case.
I could access Graby's logs in Wallabag, but nothing related to the login is logged.

If by any chance someone knows other websites with two-step login pages that work with Graby, I would be happy to have a look.
Otherwise, if it's not possible, I might try to help but my PHP skills are very limited.

Thank you anyway for this nice project!

@j0k3r
Copy link
Owner

j0k3r commented May 24, 2023

There is more and more website doing that behavior.
That's a good point and it's not supported at the moment.

@Merinorus Merinorus changed the title Site that requires login, with login page in two steps Support for websites with login page in two steps Dec 10, 2023
@briankaemingk
Copy link

Yes, indeed. I landed here because https://www.wsj.com/ now has this two-step behavior as well.

Thank you for bringing this up, @Merinorus and thank you for your work, @j0k3r

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