Page MenuHomePhabricator

Can't seem to configure GoogleLogin correctly
Closed, InvalidPublic



I'm REL1_33 on core and all extensions.

I've followed the setup as best I can, but the Googly APIs have all changed...
-> Credentials
-> OAuth Client ID
-> Web Application
-> Authorised JavaScript origins =
-> Authorised redirect URIs =

I get the info:
OAuth is limited to 100 sensitive scope logins until the OAuth consent screen is verified. This may require a verification process that can take several days.

Which don't look relevant, because I didn't do any scopes...

There is the whole concept of an app that I don't understand...

Anyway, When I set the various config:

# See
wfLoadExtension( 'GoogleLogin' );
$wgGLSecret = 'Q.....................A';
$wgGLAppId = '';
$wgWhitelistRead = array( 'Special:GoogleLoginReturn' );
$wgShowExceptionDetails = true;

I get the following error when trying to login:

[YH7WeXKupN1rfbIjMvkh@gAAAFI] /index.php?title=Special:UserLogin&returnto=Main+Page Error from line 27 of /var/www/html/mediawiki/extensions/GoogleLogin/includes/GoogleLogin.php: Class 'Google_Client' not found


#0 /var/www/html/mediawiki/extensions/GoogleLogin/includes/Auth/GooglePrimaryAuthenticationProvider.php(362): GoogleLogin\GoogleLogin::getClient(string, string)
#1 /var/www/html/mediawiki/extensions/GoogleLogin/includes/Auth/GooglePrimaryAuthenticationProvider.php(346): GoogleLogin\Auth\GooglePrimaryAuthenticationProvider->getGoogleClient()
#2 /var/www/html/mediawiki/extensions/GoogleLogin/includes/Auth/GooglePrimaryAuthenticationProvider.php(42): GoogleLogin\Auth\GooglePrimaryAuthenticationProvider->beginGoogleAuthentication(array, string)
#3 /var/www/html/mediawiki/includes/auth/AuthManager.php(454): GoogleLogin\Auth\GooglePrimaryAuthenticationProvider->beginPrimaryAuthentication(array)
#4 /var/www/html/mediawiki/includes/auth/AuthManager.php(384): MediaWiki\Auth\AuthManager->continueAuthentication(array)
#5 /var/www/html/mediawiki/includes/specialpage/AuthManagerSpecialPage.php(353): MediaWiki\Auth\AuthManager->beginAuthentication(array, string)
#6 /var/www/html/mediawiki/includes/specialpage/AuthManagerSpecialPage.php(482): AuthManagerSpecialPage->performAuthenticationStep(string, array)
#7 /var/www/html/mediawiki/includes/htmlform/HTMLForm.php(660): AuthManagerSpecialPage->handleFormSubmit(array, VFormHTMLForm)
#8 /var/www/html/mediawiki/includes/specialpage/AuthManagerSpecialPage.php(416): HTMLForm->trySubmit()
#9 /var/www/html/mediawiki/includes/specialpage/LoginSignupSpecialPage.php(313): AuthManagerSpecialPage->trySubmit()
#10 /var/www/html/mediawiki/includes/specialpage/SpecialPage.php(569): LoginSignupSpecialPage->execute(NULL)
#11 /var/www/html/mediawiki/includes/specialpage/SpecialPageFactory.php(558): SpecialPage->run(NULL)
#12 /var/www/html/mediawiki/includes/MediaWiki.php(288): MediaWiki\Special\SpecialPageFactory->executePath(Title, RequestContext)
#13 /var/www/html/mediawiki/includes/MediaWiki.php(865): MediaWiki->performRequest()
#14 /var/www/html/mediawiki/includes/MediaWiki.php(515): MediaWiki->main()
#15 /var/www/html/mediawiki/index.php(42): MediaWiki->run()
#16 {main}

Please let me know what to do to help debug

Event Timeline

I get the feeling that this may be a PHP issue... I'm running PHP 7.2.24-0ubuntu0.18.04.7

[14:57:13] <Reedy> faceface: fyi, REL1_33 has been unsupported for a while
[14:57:28] <Reedy> EOL June 2020
[14:58:01] <Reedy> And the error you list looks like you've not run composer
[14:58:08] <Reedy> (in/for the extension)

Only when installing from git run Composer to install PHP dependencies, by issuing composer install --no-dev in the extension directory.

Yeep... seems to be 'working' now (after running composer in the extension directory)...

Seeing the 'login with google' box, but then getting bounced back to a message that reads:

The supplied credentials are not associated with any user on this wiki.

Please note that when logging in 'normally' I have configured TOTP using OATHAuth. Not sure if that causes problems?

I've tried changing the wgGLSecret and wgGLAppId just to rule those out, and indeed changing either creates a different error from google (as expected).

I'm not sure what the

The supplied credentials are not associated with any user on this wiki.

issue means.

Thanks to Reedy, I updated to version 35. Unfortunately, I still get the same error, "The supplied credentials are not associated with any user on this wiki."

I had expected a new user to be created... Am I doing something wrong?

Many thanks,

Ah, OK, now I know what authoritative mode means... Ideally this could work alongside password based authentication and also pull the users profile name to set it as the wiki username...

I create a user using 'create with google', and that did work. that user could login with google.

I created a user using a given gmail address (and different username), but that user couldn't loin with google.

Thanks for this great extension, it very nearly works for me!

The fact that you need to either:

  • have created an account with the GoogleLogin extension (so the link between the Google account and the wiki account is done) _or_
  • link the Google account with an existing wiki account through Special:LinkAccounts first _or_
  • use the authoritative mode

Is a known limitation. See T138678: AuthManager should support to create a new account for a Link PrimaryAuthenticationProvider for more details on that :) Until then you need to choose one of the above options sadly :(

As this is not an issue with the extension per se and the questions are answered as well, I'm going ahead and close this task :) Feel free to reopen or open a new task if you find a bug or missing feature.