Extension talk:GoogleLogin

Jump to navigation Jump to search

About this board

Error con Extension talk:GoogleLogin

2
Nahueldev (talkcontribs)

Hola, estoy tratando de usar GoogleLogin, al momento de terminar la configuracion basica y querer loguearme me genera el siguiente error.

[bd7e4d07ed69db2b93b74049] /mw19/index.php?title=Special:UserLogin&returnto=Main+Page Error from line 27 of /home/koiurban/elbucle.com.ar/mw19/extensions/GoogleLogin/includes/GoogleLogin.php: Class 'Google_Client' not found

Backtrace:

#0 /home/koiurban/elbucle.com.ar/mw19/extensions/GoogleLogin/includes/Auth/GooglePrimaryAuthenticationProvider.php(393): GoogleLogin\GoogleLogin::getClient(string, string)

#1 /home/koiurban/elbucle.com.ar/mw19/extensions/GoogleLogin/includes/Auth/GooglePrimaryAuthenticationProvider.php(373): GoogleLogin\Auth\GooglePrimaryAuthenticationProvider->getGoogleClient()

#2 /home/koiurban/elbucle.com.ar/mw19/extensions/GoogleLogin/includes/Auth/GooglePrimaryAuthenticationProvider.php(41): GoogleLogin\Auth\GooglePrimaryAuthenticationProvider->beginGoogleAuthentication(array, string)

#3 /home/koiurban/elbucle.com.ar/mw19/includes/auth/AuthManager.php(458): GoogleLogin\Auth\GooglePrimaryAuthenticationProvider->beginPrimaryAuthentication(array)

#4 /home/koiurban/elbucle.com.ar/mw19/includes/auth/AuthManager.php(388): MediaWiki\Auth\AuthManager->continueAuthentication(array)

#5 /home/koiurban/elbucle.com.ar/mw19/includes/specialpage/AuthManagerSpecialPage.php(354): MediaWiki\Auth\AuthManager->beginAuthentication(array, string)

#6 /home/koiurban/elbucle.com.ar/mw19/includes/specialpage/AuthManagerSpecialPage.php(484): AuthManagerSpecialPage->performAuthenticationStep(string, array)

#7 /home/koiurban/elbucle.com.ar/mw19/includes/htmlform/HTMLForm.php(690): AuthManagerSpecialPage->handleFormSubmit(array, VFormHTMLForm)

#8 /home/koiurban/elbucle.com.ar/mw19/includes/specialpage/AuthManagerSpecialPage.php(417): HTMLForm->trySubmit()

#9 /home/koiurban/elbucle.com.ar/mw19/includes/specialpage/LoginSignupSpecialPage.php(313): AuthManagerSpecialPage->trySubmit()

#10 /home/koiurban/elbucle.com.ar/mw19/includes/specialpage/SpecialPage.php(575): LoginSignupSpecialPage->execute(NULL)

#11 /home/koiurban/elbucle.com.ar/mw19/includes/specialpage/SpecialPageFactory.php(611): SpecialPage->run(NULL)

#12 /home/koiurban/elbucle.com.ar/mw19/includes/MediaWiki.php(296): MediaWiki\Special\SpecialPageFactory->executePath(Title, RequestContext)

#13 /home/koiurban/elbucle.com.ar/mw19/includes/MediaWiki.php(900): MediaWiki->performRequest()

#14 /home/koiurban/elbucle.com.ar/mw19/includes/MediaWiki.php(527): MediaWiki->main()

#15 /home/koiurban/elbucle.com.ar/mw19/index.php(44): MediaWiki->run()

#16 {main}


Este es mi LocalSettings,


#GoogleLogin

wfLoadExtension (  'GoogleLogin'  );

#config

$wgGLSecret  =  'idsecret' ;

$wgGLAppId  =  'appid' ;

$wgGLReplaceMWLogin = true;

$wgGLForceKeepLogin = true;

$wgWhitelistRead = array( 'Special:GoogleLogin' );

#errores

$wgShowExceptionDetails=true;

Podrian ayudarme y comentarme donde estaria fallando, ??


Slds

PiotrKotowski (talkcontribs)

Hey,

in my case I had the same error with mediawiki 1.34 and Google Login plugin. To solve the issue I had :

- downloaded the master version of plugin (latest development version)

- set up composer

- adjusted composer.json :

"require": {
       "guzzlehttp/guzzle": "dev-6.5-functions as 6.5.3"
   },
   "repositories": [
       {"type": "vcs", "url": "git@github.com:GrahamCampbell/guzzle.git"}
   ]


- run 'composer update composer update --no-dev'


Also, I needed to run ' php updatePublicSuffixArray.php' (from maintenance dir) since I had been generally updating the mediawiki.


Good luck,

Piotr

Reply to "Error con Extension talk:GoogleLogin"

Is there any way to keep original login/signup but use GoogleLogin as additional option?

1
Tiwari.mayank24 (talkcontribs)

Hey,


I was able to complete the setup using


wfLoadExtension( 'GoogleLogin' );
$wgGLSecret = '';
$wgGLAppId = '-.apps.googleusercontent.com';
$wgGLAuthoritativeMode = 'true';
$wgGroupPermissions['*']['autocreateaccount'] = true;
$wgInvalidUsernameCharacters = "%";
$wgUserrightsInterwikiDelimiter = "%";
$wgInvalidUsernameCharacters = "%";
$wgAuthManagerConfig = [
    'primaryauth' => [
        GoogleLogin\Auth\GooglePrimaryAuthenticationProvider::class => [
            "class" => GoogleLogin\Auth\GooglePrimaryAuthenticationProvider::class,
            "sort" => 0
        ]
    ],
    'preauth' => [],
    'secondaryauth' => [],
];


But this disabled the traditional login/signup completely, but we are a public wiki and have hundreds of users and profiles, with lots of contributions and not possibly using google based accout. Is there any way to keep old login/signup and use google as additional option to signup/login ?

Reply to "Is there any way to keep original login/signup but use GoogleLogin as additional option?"

Best practices for authoritative account creation with GoogleLogin?

2
Wolfhelius (talkcontribs)

Hi Folks -

I have been going a bit in circles in trying to get the authoritative mode thing to work so that users with logins at my company can login with their credentials without creating an account on the wiki.


I have used

- GoogleLogin-REL1_34-c395c86.tar.gz

- mediawiki-extensions-GoogleLogin-master.tar.gz (download 1/16/20)

- git clone (link to github) mediawiki-extensions-GoogleLogin.git (download 1/16/20)


I have setup my LocalSettings.php with the following and various commented and uncommented variants based on multiple threads here:

require_once "$IP/extensions/GoogleLogin/GoogleLogin.php";
wfLoadExtension( 'GoogleLogin' );
$wgGLAllowedDomains = array( 'mydomain.com' );
$wgGLAllowedDomainsStrict = 'true';
$wgGLSecret = '****';
$wgGLAppId = '****';
$wgGroupPermissions['*']['read'] = false;
$wgWhitelistRead = array( 'Special:GoogleLoginReturn' );
$wgGLAuthoritativeMode = 'true';
$wgGroupPermissions['*']['autocreateaccount'] = true;
$wgUserrightsInterwikiDelimiter = "%";
$wgInvalidUsernameCharacters = "%";
$wgAuthManagerConfig = [    
  'primaryauth' => [
    GooglePrimaryAuthenticationProvider::class => [
      "class" => GooglePrimaryAuthenticationProvider::class,
      "sort" => 0
    ]
  ],
  'preauth' => [],
  'secondaryauth' => [],
];

My errors include some combination of

1)

Fatal error: Uncaught GoogleLogin\ConfigurationError: GoogleLogin runs in authoritative mode, but multiple primary authentication providers where found.

2)

Fatal error: Uncaught Error: Class 'GooglePrimaryAuthenticationProvider' not found in /homepages/14/d387179246/htdocs/pruebawiki/vendor/wikimedia/object-factory/src/ObjectFactory.php:77 Stack trace: #0

3)

No error, but after choosing a user in the Google Auth modal, we don't return to the wiki, we return to the same user selection modal.


Is there a definitive "best practices" to use the Authoritative mode for a company wishing to use Mediawiki privately using their domain's login, making use of that login to automatically create a new account?

Florianschmidtwelzow (talkcontribs)

To the first error: You need to change GooglePrimaryAuthenticationProvider::class => [ to a fully qualified class name, like GoogleLogin\Auth\GooglePrimaryAuthenticationProvider::class => [. This should resolve the error.

To the second error: You need to change "class" => GooglePrimaryAuthenticationProvider::class, to a fully qualified class name, like "class" => GoogleLogin\Auth\GooglePrimaryAuthenticationProvider::class,. This should resolve the error.

To the third question: Interesting, never had that. Do you've the same issue with other applications, which use the Google OAuth login as well, as well? I'm not sure, how this could be solved by the GoogleLogin extension, sounds more like a problem with the login UI from Google. Did you try another browser maybe?

Reply to "Best practices for authoritative account creation with GoogleLogin?"
213.83.10.170 (talkcontribs)

Hi,

I get the error message below when I try to use this plugin


What I did:

- install mediawiki 1.34.0

- download and install GoogleLogin for 1.34 (GoogleLogin-REL1_34-c395c86.tar.gz) according to the manual

- contrary to what the manual says I DID install PHP dependencies with imposer even though I did not install with git


guzzlehttp/guzzle is version 6.5.2 according to composer and 6.3.3 according to Mediawiki version page


one thing I noticed: GoogleLogin is not shown as plugin on the versions page


when I try to log in, I can select my Google account, but then I get an error


What did I do wrong?

Can I fix it?

Can you fix it?


Thanks a lot

Martin


[XhSRTYZoZnot-@r6z4wiPgAAAB8] /index.php?title=Special:UserLogin&returnto=Main+Page Error from line 220 of /home/wiki3478/public_html/extensions/GoogleLogin/vendor/guzzlehttp/guzzle/src/Client.php: Call to undefined function GuzzleHttp\_idn_uri_convert()

Backtrace:

#0 /home/wiki3478/public_html/extensions/GoogleLogin/vendor/guzzlehttp/guzzle/src/Client.php(113): GuzzleHttp\Client->buildUri(GuzzleHttp\Psr7\Uri, array)

#1 /home/wiki3478/public_html/extensions/GoogleLogin/vendor/guzzlehttp/guzzle/src/Client.php(130): GuzzleHttp\Client->sendAsync(GuzzleHttp\Psr7\Request, array)

#2 /home/wiki3478/public_html/extensions/GoogleLogin/vendor/google/auth/src/HttpHandler/Guzzle6HttpHandler.php(34): GuzzleHttp\Client->send(GuzzleHttp\Psr7\Request, array)

#3 /home/wiki3478/public_html/extensions/GoogleLogin/vendor/google/auth/src/OAuth2.php(502): Google\Auth\HttpHandler\Guzzle6HttpHandler->__invoke(GuzzleHttp\Psr7\Request)

#4 /home/wiki3478/public_html/extensions/GoogleLogin/vendor/google/apiclient/src/Google/Client.php(195): Google\Auth\OAuth2->fetchAuthToken(Google\Auth\HttpHandler\Guzzle6HttpHandler)

#5 /home/wiki3478/public_html/extensions/GoogleLogin/includes/Auth/GooglePrimaryAuthenticationProvider.php(417): Google_Client->fetchAccessTokenWithAuthCode(string)

#6 /home/wiki3478/public_html/extensions/GoogleLogin/includes/Auth/GooglePrimaryAuthenticationProvider.php(54): GoogleLogin\Auth\GooglePrimaryAuthenticationProvider->getVerifiedToken(GoogleLogin\Auth\GoogleServerAuthenticationRequest)

#7 /home/wiki3478/public_html/includes/auth/AuthManager.php(525): GoogleLogin\Auth\GooglePrimaryAuthenticationProvider->continuePrimaryAuthentication(array)

#8 /home/wiki3478/public_html/includes/specialpage/AuthManagerSpecialPage.php(356): MediaWiki\Auth\AuthManager->continueAuthentication(array)

#9 /home/wiki3478/public_html/includes/specialpage/AuthManagerSpecialPage.php(484): AuthManagerSpecialPage->performAuthenticationStep(string, array)

#10 /home/wiki3478/public_html/includes/htmlform/HTMLForm.php(690): AuthManagerSpecialPage->handleFormSubmit(array, VFormHTMLForm)

#11 /home/wiki3478/public_html/includes/specialpage/AuthManagerSpecialPage.php(417): HTMLForm->trySubmit()

#12 /home/wiki3478/public_html/includes/specialpage/LoginSignupSpecialPage.php(313): AuthManagerSpecialPage->trySubmit()

#13 /home/wiki3478/public_html/includes/specialpage/SpecialPage.php(575): LoginSignupSpecialPage->execute(NULL)

#14 /home/wiki3478/public_html/includes/specialpage/SpecialPageFactory.php(611): SpecialPage->run(NULL)

#15 /home/wiki3478/public_html/includes/MediaWiki.php(296): MediaWiki\Special\SpecialPageFactory->executePath(Title, RequestContext)

#16 /home/wiki3478/public_html/includes/MediaWiki.php(900): MediaWiki->performRequest()

#17 /home/wiki3478/public_html/includes/MediaWiki.php(527): MediaWiki->main()

#18 /home/wiki3478/public_html/index.php(44): MediaWiki->run()

#19 {main}


213.83.10.170 (talkcontribs)

(just for the record)

I did not test this with the GoogleLogin plugin itself, but for the Oauth2client plugin which experiences the same problem, it helped setting the version of guzzlehttp/guzzle to install specifically to 6.3.3

there it worked after changing this in /extensions/MW-OAuth2Client/vendors/oauth2-client/composer.json before starting the composer step during installation

maybe a similar approach works with GoogleLogin

Martin

186.167.243.89 (talkcontribs)

Hello team,

How can I set the version for guzzlehttp/guzzle to 6.33 ? Thanks!

Wolfhelius (talkcontribs)

I changed composer.json in the MW root directory to specify the version. (I found success on this error by using 6.5.2)

Florianschmidtwelzow (talkcontribs)

How to manually create account

3
Summary by Florianschmidtwelzow

Not a bug, just an explanation of how to manually create a connection between an arbritary wiki account as an admin.

Electron.rotoscope (talkcontribs)

I'm using GoogleLogin: REL1_33 | 2019-06-17T19:10:00 | 31ece02 with MediaWiki 1.33 which I understand doesn't support AuthoritativeMode, but just in case it's relevant and I just have a configuration error I've put what I think are the relevant portions of LocalSettings.php below

If I have to create users manually I'm happy to do it, but I don't understand how I can do that. Is it as simple as logging in with the default admin user (not authenticated through google) and then creating users with the right email address as their username? I see that it asks for a Google ID, is that still relevant? Will it still be relevant with the new API etc?

Thanks!!!


<?php

use GoogleLogin\Auth\GooglePrimaryAuthenticationProvider;

$wgGroupPermissions['*']['createaccount'] = true;

$wgGroupPermissions['*']['edit'] = false;

$wgGroupPermissions['*']['read'] = false;

wfLoadExtension( 'GoogleLogin' );

$wgWhitelistRead = array( 'Special:GoogleLoginReturn' );

$wgGLSecret = 'fromgoogledevel';

$wgGLAppId = 'fromgoogledevel';

$wgGLAllowedDomains = array( 'ourgsuitedomain.com' );

$wgGLAllowedDomainsStrict = true;

$wgGLAuthoritativeMode = true;

$wgGroupPermissions['*']['autocreateaccount'] = true;

$wgInvalidUsernameCharacters = '\|';

$wgUserrightsInterwikiDelimiter = '\|';


Electron.rotoscope (talkcontribs)

Sorry I should mention the error I'm getting is "The supplied credentials are not associated with any user on this wiki."

Electron.rotoscope (talkcontribs)

For anyone looking in the future, the solution I've found that seems to work is:

Put // ahead of $wgGLReplaceMWLogin = true; if you have it in your settings and it's actually working (actually it stopped working for me, anyone know why?)

Login as an admin account

From Special:SpecialPages go to Create account (Special:CreateAccount) and make an account with any username and a password no-one ever need use

Get the user to go to https://picasaweb.google.com while signed in, it should redirect to a URL with a 21 digit number at the end

From Special:SpecialPages go to Manage GoogleLogin connections (Special:ManageGoogleLogin), remove a number if currently associated, and add the number from that picasa address

The user should now be able to login with the google login button

If it asks you to run the updatePublicSufficArray and you're not used to running php scripts, you need to SSH onto the server and run the command (assuming your path is www/www) php www/www/extensions/GoogleLogin/maintenance/updatePublicSuffixArray.php

Missing Id_token and setAccessToken

2
GuardianCosmos (talkcontribs)

Getting the following error with everything configured according to documentation, wondering if the latest build has a typo or similar that could be causing this? The accounts are already properly linked.

Mediawiki version 1.31.2 and plugin version 0.4.0-git

[127ff4480901c5e4d43dc2c0] /mediawiki/index.php/Special:LinkAccounts LogicException from line 712 of /var/lib/mediawiki/extensions/GoogleLogin/vendor/google/apiclient/src/Google/Client.php: id_token must be passed in or set as part of setAccessToken

Backtrace:

#0 /var/lib/mediawiki/extensions/GoogleLogin/includes/Auth/GooglePrimaryAuthenticationProvider.php(263): Google_Client->verifyIdToken()

#1 /usr/share/mediawiki/includes/auth/AuthManager.php(1950): GoogleLogin\Auth\GooglePrimaryAuthenticationProvider->continuePrimaryAccountLink(User, array)

#2 /usr/share/mediawiki/includes/specialpage/AuthManagerSpecialPage.php(364): MediaWiki\Auth\AuthManager->continueAccountLink(array)

#3 /usr/share/mediawiki/includes/specialpage/AuthManagerSpecialPage.php(482): AuthManagerSpecialPage->performAuthenticationStep(string, array)

#4 /usr/share/mediawiki/includes/htmlform/HTMLForm.php(660): AuthManagerSpecialPage->handleFormSubmit(array, OOUIHTMLForm)

#5 /usr/share/mediawiki/includes/specialpage/AuthManagerSpecialPage.php(416): HTMLForm->trySubmit()

#6 /usr/share/mediawiki/includes/specials/SpecialLinkAccounts.php(59): AuthManagerSpecialPage->trySubmit()

#7 /usr/share/mediawiki/includes/specialpage/SpecialPage.php(565): SpecialLinkAccounts->execute(NULL)

#8 /usr/share/mediawiki/includes/specialpage/SpecialPageFactory.php(568): SpecialPage->run(NULL)

#9 /usr/share/mediawiki/includes/MediaWiki.php(288): SpecialPageFactory::executePath(Title, RequestContext)

#10 /usr/share/mediawiki/includes/MediaWiki.php(861): MediaWiki->performRequest()

#11 /usr/share/mediawiki/includes/MediaWiki.php(524): MediaWiki->main()

#12 /usr/share/mediawiki/index.php(42): MediaWiki->run()

#13 {main}

@Florianschmidtwelzow

Florianschmidtwelzow (talkcontribs)

Hi!

Thanks for pointing this out, I tried to recreate this issue, however, I was unable to do so. Did you really have installed the latest versions and also updated the composer dependencies? From what I saw in the code, this behaviour should be nearly impossible to reach (that's also why there's a logic exception). Did you tried to link the account again?

Thanks in advance for your answer :)

Best, Florian

Reply to "Missing Id_token and setAccessToken"

GooglePrimaryAuthenticationProvider not found

3
Summary by Florianschmidtwelzow

Missing use/import of GoogleLoginPrimaryAuthenticationProvider class.

144.208.212.18 (talkcontribs)

Hi,


I am running MediaWiki 1.33 with docker. When adding GooglePrimaryAuthenticationProvider as my primary provider to enable account creation, I get the error:


Fatal error: Uncaught Error: Class 'GooglePrimaryAuthenticationProvider' not found in /var/www/html/vendor/wikimedia/object-factory/src/ObjectFactory.php:77 Stack trace: #0 /var/www/html/includes/auth/AuthManager.php(2311): Wikimedia\ObjectFactory::getObjectFromSpec(Array) #1 /var/www/html/includes/auth/AuthManager.php(2364): MediaWiki\Auth\AuthManager->providerArrayFromSpecs('MediaWiki\\Auth\\...', Array) #2 /var/www/html/includes/auth/AuthManager.php(922): MediaWiki\Auth\AuthManager->getPrimaryAuthenticationProviders() #3 /var/www/html/includes/skins/SkinTemplate.php(705): MediaWiki\Auth\AuthManager->canCreateAccounts() #4 /var/www/html/includes/skins/SkinTemplate.php(463): SkinTemplate->buildPersonalUrls() #5 /var/www/html/includes/skins/SkinTemplate.php(228): SkinTemplate->prepareQuickTemplate() #6 /var/www/html/includes/OutputPage.php(2723): SkinTemplate->outputPage() #7 /var/www/html/includes/exception/MWExceptionRenderer.php(134): OutputPage->output() #8 /var/www/html/includes/exception/MWExceptionRenderer.php(53): in /var/www/html/vendor/wikimedia/object-factory/src/ObjectFactory.php on line 77

I am using the latest code from your git I guess and install the extension that way:

From mediawiki:latest

RUN git clone --depth 1 -b master \

      https://gerrit.wikimedia.org/r/p/mediawiki/extensions/GoogleLogin \

      /var/www/html/extensions/GoogleLogin

RUN cd /var/www/html/extensions/GoogleLogin/ && composer install --no-dev


I can see the GooglePrimaryAuthenticationProvider file in includes/Auth.


In my LocalConfig I have set


$wgAuthManagerConfig = [

 'primaryauth' => [
   GooglePrimaryAuthenticationProvider::class => [
     "class" => GooglePrimaryAuthenticationProvider::class,
     "sort" => 0
   ]
 ],
 'preauth' => [],
 'secondaryauth' => [],

];


Thanks!

Florianschmidtwelzow (talkcontribs)

Hi! Thanks for posting here :) First of all, this looks like you missed something. The GoogleLogin Code is actually part of a namespace (GoogleLogin\Auth), so you can not simply use GooglePrimaryAuthenticationProvider::class without specifying it with a fully-qualified namespace, or importing it. So, in your case, it should be enough to add the following line at the top of your LocalSettings.php right after the starting php tag (<?php):

use GoogleLogin\Auth\GooglePrimaryAuthenticationProvider;

Let me know if that worked!

Philuko (talkcontribs)

Thanks, works like a charm!

Automatically register anyone who logs-in with a Google account

5
Domtron vox (talkcontribs)

Is there a way to make the plugin or AuthManager automatically register wiki accounts for people logging in with google accounts for the first time? I searched for this and couldn't find anything, but a generic remote user extension that has an auto register option, but no clue how hard it would be to get working with google accounts.

I would like for anyone in the company to seamlessly login without needing to stop and create an account.

Thanks!

Info Dump:

I have the wiki login restricted to certain custom gmail domains.

Hosted on reseller cPanel/WHM

PHP 7.0

MediaWiki 1.30 (Installed with cPanel one click install)

GoogleLogin Version file: GoogleLogin: REL1_30 2017-09-21T22:09:00 f594074

Domtron vox (talkcontribs)

Realized this is really important because anyone can still register an account using the registration field. I want to Disable normal mediawiki login process using the $wgAuthManagerAutoConfig['primaryauth'] = []; config but then users can't register their google account via the Special:CreateAccount page since it is effectivly removed when the GoogleLogin login setup takes over. :/

Am I missing something? I've read the wiki page and this discussion page multiple times and just can't figure out what I'm doing wrong.

Florianschmidtwelzow (talkcontribs)

Hi, this is currently not possible (at least not from the UI, see more in the second section of my answer), sorry :( The difference with GoogleLogin and the Auth_remoteuser extension is, that GoogleLoign actually is an authentication provider. It gives MediaWiki an additional way to authenticate a specific user inside of MediaWiki. On the other hand, Auth_remoteuser is a so called SessionProvider. It provides a possibility to get a session based on a specific environment variable, so the user does not need to authenticate with MediaWiki, the user is coming from a different source.

There's actually the task T138678 which goal it is to provide a way to auto-create a new wiki-user if no user already exists when using an authentication provider other than MediaWiki's own one. However, we're currently not really actively working on it :( The AuthManager already provides a way of automatically linking an account when someone if logging in the first time, however, it's not yet exposed in the UI.

Jsmith6 (talkcontribs)

Florianschmidtwelzow, this is great information. Thank you.

The main issue that I am having is that once new users are authorized in our wiki, their wiki account should get linked to their Google account once they login. But instead, they get the error message "The supplied credentials are not associated with any user on this wiki".

We are not trying to create a wiki account upon authentication with Google, but simply to link an existing wiki account with an existing Google account.

Above, you said: "The AuthManager already provides a way of automatically linking an account when someone if logging in the first time, however, it's not yet exposed in the UI."

Could you please advise how to avail ourselves of this?

Chabamkazam (talkcontribs)

Was a solution ever found to this? I am having the exact same problem described by Jsmith6, but have been unable to figure out how to do this

Reply to "Automatically register anyone who logs-in with a Google account"

Manually creating a user in preparation?

5
Mqw190238 (talkcontribs)

Hello

I understand the restriction with not being able to auto create MediaWiki accounts using this extension now. That is not what this is about. How do you manually create a MediaWiki user before hand though to link the Google account to if you only have Google Login auth enabled?

If I go to /Special:CreateAccount and enter a username, ie. "Joe Bloggs" I get the error "Your Google account is already linked to another user. Please unlink the connection or contact an administrator, if you have no other wiki account." when I click on the only button I have "Create with Google". Here lies the issue I think because what is that trying to do, that button and message makes no sense? I just want to create a local user to then link them up via /Special:ManageGoogleLogin. I am not trying to do anything with mine (yes of course it's already linked).

I have $wgAuthManagerAutoConfig['primaryauth'] = []; and $wgGroupPermissions['*']['createaccount'] = false; so I think it is not allowing local creation because of that on /Special:CreateAccount? I do not want users to log in with local authentication though.

So how do you create local accounts to link Google accounts to for log in while not allowing local logins? Or I have misunderstood?

Currently I get around this manually by in the database adding a new row to the user table, then using /Special:ManageGoogleLogin to link that user and Google ID. Surely I should be able to do this all via the web UI though?

Edit: Apologies, forgot version details:

MediaWiki 1.32.0

GoogleLogin 0.4.0-git (0b27530)

Many thanks!

Florianschmidtwelzow (talkcontribs)

Hi! I might have difficulties to get the actual problem and your setup, please, if the answer does not help you, try to give some more streamlined information and please just provide necessary information which might help in this case :)

If I understood you correctly you want to have the following setup:

  • GoogleLogin is the only available authentication provider
  • Logins and account creation should be possible with Google only

If that's the case, your problem might be related to the fact, that you disabled account creation at all for every not-logged in user. You need to allow an anonmyous user to be able to login by setting $wgGroupPermissions['*']['createaccount'] = true; in your LocalSettings.php. You'll disable account creation without GoogleLogin by disabling all available authentication providers, except GoogleLogin. This can be done by adding this to your LocalSettings.php:

$wgAuthManagerConfig = [

 'primaryauth' => [
   GooglePrimaryAuthenticationProvider::class => [
     "class" => GooglePrimaryAuthenticationProvider::class,
     "sort" => 0
   ]
 ],
 'preauth' => [],
 'secondaryauth' => [],

];

Then you should be able to login with your Google account only. Account creation is also possible with your Google account.

Btw.: There's also this task to automatically create an account when a local account for the Google account does not exist, it is, however, not implemented, yet: https://phabricator.wikimedia.org/T186080

Please let me know, if there're still open questions :)

Best, Florian

Florianschmidtwelzow (talkcontribs)
81.61.169.155 (talkcontribs)

Hi! I followed the steps for the authoritative mode, but I still get the same problem. How do I accomplish this?:


  • GoogleLogin needs to be the only primary authentication provider


The code you posted up here returns this error:

Fatal error: Uncaught Error: Class 'GooglePrimaryAuthenticationProvider' not found in /homepages/14/d387179246/htdocs/pruebawiki/vendor/wikimedia/object-factory/src/ObjectFactory.php:77 Stack trace: #0 /homepages/14/d387179246/htdocs/pruebawiki/includes/auth/AuthManager.php(2311): Wikimedia\ObjectFactory::getObjectFromSpec(Array) #1 /homepages/14/d387179246/htdocs/pruebawiki/includes/auth/AuthManager.php(2364): MediaWiki\Auth\AuthManager->providerArrayFromSpecs('MediaWiki\\Auth\\...', Array) #2 /homepages/14/d387179246/htdocs/pruebawiki/includes/auth/AuthManager.php(922): MediaWiki\Auth\AuthManager->getPrimaryAuthenticationProviders() #3 /homepages/14/d387179246/htdocs/pruebawiki/includes/skins/SkinTemplate.php(705): MediaWiki\Auth\AuthManager->canCreateAccounts() #4 /homepages/14/d387179246/htdocs/pruebawiki/includes/skins/SkinTemplate.php(463): SkinTemplate->buildPersonalUrls() #5 /homepages/14/d387179246/htdocs/pruebawiki/includes/skins/SkinTemplate.php(228): SkinTemplate->prepareQuickTemplate() #6 /homepages/14/d38717 in /homepages/14/d387179246/htdocs/pruebawiki/vendor/wikimedia/object-factory/src/ObjectFactory.php on line 77

Thanks!

Florianschmidtwelzow (talkcontribs)

Hi!

What exactly is the configuration you added to your LoclSettings.php? And did you actually get a new copy of GoolgeLogin in the latest development version "master"?

Best, Florian

Reply to "Manually creating a user in preparation?"

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

2
125.236.194.84 (talkcontribs)

Hi Florian,

These are my wiki specs below:

Product Version
MediaWiki] 1.33.0
7.2.19-0ubuntu0.18.04.2 (apache2handler)
5.7.27-0ubuntu0.18.04.1

And I'm trying to enable Authoritative Mode for Google Login as described here. This is what I currently have in my LocalSettings.php:

$wgGLSecret = '-';
$wgGLAppId = '-';
$wgGLAllowedDomains = array( 'url.com' );
$wgGLAllowedDomainsStrict = 'true';
$wgWhitelistRead = array( 'Special:GoogleLoginReturn' );
$wgGLAuthoritativeMode = 'true';
$wgGroupPermissions['*']['autocreateaccount'] = true;
$wgUserrightsInterwikiDelimiter = "%";
$wgInvalidUsernameCharacters = "%";$wgShowExceptionDetails = 'true';

But when I try and log in with Google, it simply states the supplied creds are not associated with any user - which I expect but am I wrong in thinking that because I have authoritative mode enabled - it should then automatically create the new account since its not linked with a local mediawiki account?


Keen to hear your thoughts.

Florianschmidtwelzow (talkcontribs)

Hi,

are you using the REL1_33 release branch of Google Login? If so, this version does not support the authoritative mode. You would need to download a new copy of GoogleLogin using the latest development version "master" in order to get this feature :-)

Best, Florian

Reply to "The supplied credentials are not associated with any user on this wiki. (1.33)"