Page MenuHomePhabricator

Login page does not link to registration page when a login attempt results in a RESTART response
Open, Needs TriagePublic

Assigned To
None
Authored By
bisongde
Feb 8 2018, 9:10 PM
Referenced Files
F13389371: wiki_login.jpg
Feb 9 2018, 5:21 PM
F13389374: google_acct.jpg
Feb 9 2018, 5:21 PM
F13389381: step_3.jpg
Feb 9 2018, 5:21 PM

Description

When displaying the login page, LoginSignupSpecialPage::showExtraInformation() suppresses various landing-page-style information (including a link to account creation). The intent is to only display these things when login starts, and keep intermediary steps (2FA etc) less distracting. A RESTART response, hovever, is conceptually equivalent to going back to the first step, but internally implemented as simply continuing login, so the extra information is not shown.

This is especially problematic when the wiki is configured with a single remote login provider, as the initial display of the login form is skipped in such a case, and some of these providers don't have any other failure mode than RESTART, so the user is effectively barred from accessing the registration page.

Event Timeline

Tgr removed Tgr as the assignee of this task.EditedFeb 8 2018, 9:40 PM

I don't think this is true (but don't have the time to test right now). The link is regulated by LoginSignupSpecialPage::showCreateAccountLink() which does not care about AuthManager configuration (it probably should, but that's another task).

This is not true, the link is still there. A "create account" link is also still present next to the "log in" link on every page (unless the wiki has $wgUseCombinedLoginLink set, or a skin that forces something similar). Also, users can still go directly to Special:CreateAccount.

I do note that if you have GoogleLogin as the only provider that adds non-skippable widgets to the login form, then Special:UserLogin will immediately redirect to Google instead of making the user click the button. That's a feature: T141474: Automatic start of authentication workflow for link provider (if it's the only available one)

Cross-posted from the Discourse thread:

Here's my config:

# End of automatically generated settings.
# Add more configuration options below.

# Disable reading by anonymous users
$wgGroupPermissions['*']['read'] = false;

# Disable anonymous editing
$wgGroupPermissions['*']['edit'] = false;

# Prevent new user registrations except by sysops
#$wgGroupPermissions['*']['createaccount'] = false;

#create Trusted User category
$wgGroupPermissions['Trusted'] = $wgGroupPermissions['user'];
$wgGroupPermissions['*']['edit'] = false;
$wgShowIPinHeader = false;$wgGroupPermissions['*']['edit'] = false;
$wgGroupPermissions['user']['edit'] = false;
$wgGroupPermissions['Trusted']['edit'] = true;
$wgGroupPermissions['sysop']['edit'] = true;

require_once "$IP/extensions/Scribunto/Scribunto.php";
$wgScribuntoDefaultEngine = 'luastandalone';
wfLoadExtension( 'ParserFunctions' );

#Restrict Access by Group
require_once "extensions/AccessControl/AccessControl.php";

#Admin Can Read All DO NOT CHANGE OR COMMENT OUT
$wgAdminCanReadAll = true;
$wgAccessControlRedirect = false;

#Create Tech Group
#$wgGroupPermissions['tech']['read'] = true;

#$wgShowExceptionDetails = true;

#Google Auth Settings
require_once "$IP/extensions/GoogleLogin/GoogleLogin.php";
$wgGLSecret = "redacted";
$wgGLAppId = "redacted";
$wgGLAllowedDomainsDB = true;
$wgGroupPermissions['sysop']['managegooglelogindomains'] = true;
$wgWhitelistRead = array( 'Special:GoogleLoginReturn', 'Special:CreateAccount', 'Special:UserLogin' );

$wgAuthManagerAutoConfig['primaryauth'] = [];

Here is what you see, step-by-step:

Step 1: What's seen when accessing the main wiki.example.com domain:

wiki_login.jpg (387×411 px, 20 KB)

Step 2: Google account selection (I select my personal profile that has my picture since it does not have an account created and should return me to Special:UserLogin):

google_acct.jpg (497×552 px, 32 KB)

Step 3: No credentials have been created for the account selected, so I'm returned to Special:UserLogin, but there is no link to Special:CreateAccount:

step_3.jpg (383×333 px, 23 KB)

If it's a useful data point, if you sit on Special:UserLogin page long enough for the session to expire and then click "Log in with Google" again, you are taken to another version of Special:UserLogin where the link is present as expected.

As long as the session is valid though you are not presented with this option, you loop between going directly to Google account selection and Special:UserLogin sans the signup link.

Tgr closed this task as Invalid.EditedFeb 9 2018, 5:35 PM
# Prevent new user registrations except by sysops
#$wgGroupPermissions['*']['createaccount'] = false;

That disables registration which is why the link will also be hidden.

# Prevent new user registrations except by sysops
#$wgGroupPermissions['*']['createaccount'] = false;

That disables registration which is why the link will also be hidden.

The line is commented out. Even entirely removed the result is the same: the link is missing from the page. It may not be a bug with AuthManagerConfig but it seems like it's a bug one way or the other.

Ok, I think I see what's going on here.

The link would be displayed on the initial view of Special:UserLogin, except it's being skipped thanks to the redirect. That's also the page you see after your session expires.

The link isn't displayed on subsequent pages of the login process. That includes when AuthManager finds that a link provider succeeded but has no username so it re-returns the initial set of AuthenticationRequests, i.e. the case covered in T138678: AuthManager should support to create a new account for a Link PrimaryAuthenticationProvider.

Oh, right! The right-side panel and bottom stuff is hidden in non-initial steps via LoginSignupSpecialPage::showExtraInformation(). I think @CCicalese_WMF also wanted to file a bug about that since it was breaking PluggableAuth in some way, but I can't recall where that was discussed.

Probably what we want to do here is setting some kind of flag when handling RESTART, and then making showExtraInformation take that into account.

Tgr renamed this task from Special:CreateAccount missing from Special:UserLogin when MW auth disabled to Login page does not link to registration page when a login attempt results in a RESTART response.Feb 10 2018, 3:02 AM
Tgr reopened this task as Open.
Tgr removed a project: GoogleLogin.
Tgr updated the task description. (Show Details)