Topic on Extension talk:GoogleLogin

[RESOLVED] Internal error "<WEBROOT>/mediawiki-1.22.2/includes/htmlform/HTMLForm.php: HTMLForm: no submit callback provided. Use setSubmitCallback() to set one."

25
93.159.254.162 (talkcontribs)

Hello,

I'm looking around for the possibility to use Google Login via OAuth and come to this great MW extension. So far so good. The documentation and configuration sample is very good but after setting everythin up I can't login an existing or create a new user via the Special Page GoogleLogin. Everytime I get the Internal error on my MW Special page after successfully login at Google:

[6893f829] /wiki/index.php?title=Special:GoogleLogin/Create Exception from line 464 of /<WEBROOT>/mediawiki-1.22.2/includes/htmlform/HTMLForm.php: HTMLForm: no submit callback provided. Use setSubmitCallback() to set one. Backtrace:

0 /<WEBROOT>/mediawiki-1.22.2/includes/htmlform/HTMLForm.php(412): HTMLForm->trySubmit()
1 /<WEBROOT>/mediawiki-1.22.2/includes/htmlform/HTMLForm.php(427): HTMLForm->tryAuthorizedSubmit()
2 /<WEBROOT>/mediawiki-1.22.2/extensions/GoogleLogin/SpecialGoogleLogin.php(248): HTMLForm->show()
3 /<WEBROOT>/mediawiki-1.22.2/extensions/GoogleLogin/SpecialGoogleLogin.php(69): SpecialGoogleLogin->GoogleUserForm(string)
4 /<WEBROOT>/mediawiki-1.22.2/includes/specialpage/SpecialPage.php(379): SpecialGoogleLogin->execute(NULL)
5 /<WEBROOT>/mediawiki-1.22.2/includes/specialpage/SpecialPageFactory.php(503): SpecialPage->run(NULL)
6 /<WEBROOT>/mediawiki-1.22.2/includes/Wiki.php(285): SpecialPageFactory::executePath(Title, RequestContext)
7 /<WEBROOT>/mediawiki-1.22.2/includes/Wiki.php(588): MediaWiki->performRequest()
8 /<WEBROOT>/mediawiki-1.22.2/includes/Wiki.php(447): MediaWiki->main()
9 /<WEBROOT>/mediawiki-1.22.2/index.php(46): MediaWiki->run()
10 {main}

How can I fix this issue?

Florianschmidtwelzow (talkcontribs)

Hello! Thanks for your message! Unhappily, this you can't fix yourself without upgrading to a newer MediaWiki-Version :/ I filled a bug bug 68097 to track this bug. There will be a patch for that. Do you use the actual git-master version?

Florianschmidtwelzow (talkcontribs)

Hello again! Can you say, what MediaWiki version you use? I tested with MW 1.22.2, but i must see, that the Extension doesn't support this version anymore (there are more changes to 1.23 as i thought, sorry). The best way is to upgrade to MW 1.23.

93.159.254.162 (talkcontribs)

Hello,

thanks a lot for the quick response. I'm using MW 1.23.0. Is it necessary to upgrade to 1.23.1? Is there anything else i.e. a patch which I can apply to my installation?

Regards Mike

Florianschmidtwelzow (talkcontribs)

Hello Mike!

Ah, ok, sorry, i was confused because your mediawiki-directory is "mediawiki-1.22.2" :) No, with MW 1.23 normally it works, i will test it, please be patient. If there is a solution (after i can reproduce this problem), there will be a patch applied to the extension repository, so then you must only download the Extension new :)

Thanks a lot for your response!

Florianschmidtwelzow (talkcontribs)

Hello again! Sorry, i can't reproduce this behavior with MediaWiki 1.23 and the latest master-version of GoogleLogin. Can you try to reload the Extension (e.g. using this link) and try to use it again? Thanks a lot!

93.159.254.162 (talkcontribs)

Hi,

I've upgraded MW to 1.23.1 already and delete the extension a get a fresh git update into the extensions folder. The error is still there. Afterwards I've playing around a little bit and uncomment...

  1. $wgGroupPermissions['*']['createaccount'] = false;

...which was disabled to reduce spamming. So, I've created a new account by the "normal" Mediawiki create account possibilities. Now, it seems that I can also login via Google Login button press, but I'm a little bit confused now. I've to choose always a valid username before pressing Login with Google. Otherwise "Login error You have not specified a valid username." is shown. 1) How can unknown user login to the wiki or create a account if the permissions are not allowed (see above). 2) If I create the new account manually (enable the createaccount permissions) and use another password to create the account than for Google I come always to the Choose name => Create acount "Special:GoogleLogin" Site. I'm currently only able to login via "Login with Google" button if both passwords (MW and Google) are the same. But in this case I can also use directly the usual Login button. 3) If I use the same passwords (MW and Google) I see no difference by pressing "Login with Google" and "Login" (Standard MW) button. Is there still a communication with Google creditials?

In my opinion only one Login-solution should be availabe.

Do I miss or misunderstand something?

Florianschmidtwelzow (talkcontribs)

Hello! Hmm, that's confusing, now you haven't the error anymore, yes?

> How can unknown user login to the wiki or create a account if the permissions are not allowed (see above)

For now, the user can create an account, still when the createaccount permission is not granted (maybe i rethink this behavior), so, if you can login with Google you can create an account, if you don't have one and createaccount right is not granted. (I think, that the problem is because of the other problems :))

> 2) and 3)

Yeah, this isn't the right behavior, this is very useless :P I think i know the problem (i think your wiki isn't in english, right?), can you please download this file and replace includes/GoogleLogin.body.php with this one? Can you then try again?

> In my opinion only one Login-solution should be availabe. For now, GoogleLogin can't replace the "normal" MediaWiki Login page, maybe, if wanted, this can be done in a future release :) (You can fill a bug, if you want: https://bugzilla.wikimedia.org/enter_bug.cgi?product=MediaWiki%20extensions&component=GoogleLogin)

Looking forward to your reply!

93.159.254.162 (talkcontribs)

Hi,

no, the error is still there if you're using a password which doesn't match to the Google one. In this case the choose username page occurs with "Create Account button". If I press this Create Account button idependent on the username I chosse (keep in mind that this user is inknown to the wiki) the error from this post occurs.

My MW installation uses English as well. Nevertheless I've downloaded your updated xxxbody.php file and replaces it on the server. I didn't see any improvement.

So the only solution which is working for me so far is: 1) Create Account manually (uncomment "$wgGroupPermissions['*']['createaccount'] = false;" first). 2) Change the password by login into MW manually to the same password than Google 3) Login with username/password of Google with "Login with Google" button press

BUT 1) The only difference if login with username/password by "Login with Google" is that the user can also use all Google services directly without an additional Google login. From MW point of view it doesn't matter if i use the standard Login button or the "Login with Google". 2) User management isn't possible without either manual user creation by an admin nor enabling unsecure "login for everyone" by uncomment $wgGroupPermissions['*']['createaccount'] = false;

I'm still looking for the feature that an unknown user can login with Google OAuth and create a new account if it's not already there as it's (oops was) with OpenID extension.

To replace the MediaWiki Login page please have a look on OpenID: If I'm right you have a separated Login page different from OpenID which should be a solution for GoogleLogin.

Florianschmidtwelzow (talkcontribs)

Hello! Can you give the link of your MediaWiki installation please? So i can have a look on it, i can't reproduce the "HTMLForm: no submit callback provided" error :/ If we fixed that, we can go to the next step, ok? :)

93.159.254.162 (talkcontribs)

http://oobd.luxen.de I've only a few minutes/hours left within the next days so from my side I can spent much more time for debugging after the weekend!

Florianschmidtwelzow (talkcontribs)

Hello! Thanks for the link :) Can you pleae load the extension new (fix the issue, that you can only login when you type in an valid username into login form, see https://gerrit.wikimedia.org/r/#/c/147114/) and load this patchset (and replace the files into your local copy). Please try then again :)

https://gerrit.wikimedia.org/r/#/c/147143/

Thanks!

(Please notice: I still can't reproduce the error, so i can't test this patch really :/ So maybe it won't work)

89.0.41.102 (talkcontribs)

Hi, thanks for the patch. I've delete my local copy at get a fresh clone one via git. I expect that the patch is included on th git repository, right! I don't see the improvement. If I use a valid username without password and press the Login with Google button I end up in the Choose name special page to create a new account. If I choose on to create a new account with a new username I see a similar error.

[d33a870a] /wiki/index.php?title=Special:GoogleLogin/Create Exception from line 464 of /var/www/vhosts/luxen.de/oobd/wiki/includes/htmlform/HTMLForm.php: HTMLForm: no submit callback provided. Use setSubmitCallback() to set one.

Backtrace:

0 /var/www/vhosts/luxen.de/oobd/wiki/includes/htmlform/HTMLForm.php(412): HTMLForm->trySubmit()
1 /var/www/vhosts/luxen.de/oobd/wiki/includes/htmlform/HTMLForm.php(427): HTMLForm->tryAuthorizedSubmit()
2 /var/www/vhosts/luxen.de/oobd/wiki/extensions/GoogleLogin/includes/specials/SpecialGoogleLogin.php(219): HTMLForm->show()
3 /var/www/vhosts/luxen.de/oobd/wiki/extensions/GoogleLogin/includes/specials/SpecialGoogleLogin.php(81): SpecialGoogleLogin->createSubmitButton(string)
4 /var/www/vhosts/luxen.de/oobd/wiki/includes/specialpage/SpecialPage.php(379): SpecialGoogleLogin->execute(NULL)
5 /var/www/vhosts/luxen.de/oobd/wiki/includes/specialpage/SpecialPageFactory.php(503): SpecialPage->run(NULL)
6 /var/www/vhosts/luxen.de/oobd/wiki/includes/Wiki.php(285): SpecialPageFactory::executePath(Title, RequestContext)
7 /var/www/vhosts/luxen.de/oobd/wiki/includes/Wiki.php(588): MediaWiki->performRequest()
8 /var/www/vhosts/luxen.de/oobd/wiki/includes/Wiki.php(447): MediaWiki->main()
9 /var/www/vhosts/luxen.de/oobd/wiki/index.php(46): MediaWiki->run()
10 {main}

Florianschmidtwelzow (talkcontribs)

Hello!

> I expect that the patch is included on th git repository, right!

Nope :) That's why i said you must download the files yourself and replace it, unhappily. The patch is now in review, that means, that it isn't merged into the git repository. Maybe the patch don't help to solve the problem or has another misfunction i not expect, or there are other code issues, that's why the code goes through code review (using gerrit), so everyone inetersted can look into the code and give an opinion what to make better before the code comes into the repository.

So, please download the files of the patchset and replace them in the includes/ folder. Here are the directlinks and the location to copy to:

https://gerrit.wikimedia.org/r/cat/147143%2C1%2Cincludes/specials/SpecialGoogleLogin.php%5E0 -> includes/specials/SpecialGoogleLogin.php
https://gerrit.wikimedia.org/r/cat/147143%2C1%2Cincludes/GoogleLogin.body.php%5E0 -> includes/GoogleLogin.body.php

Sorry for the confusion!

89.0.29.169 (talkcontribs)

Hi, OK I've applied the patch and exchange the two files. The error is now not available but if I keep the login information empty and press directly "Login with Google" I can successfully login to Goggle.
Afterwards I've to choose a username to create a account. Independent if the MW parameter "$wgGroupPermissions['*']['createaccount'] = false;" is set or unset I come to the choose username Special page and cannot create/link a new account. The result isn't an error message as before. Now I see this information screen:

Choose username
Account information
In the following table you find information about your Google account and if it is linked to a wiki account or not.
Google-ID <Google ID number>
Google user <Google username>
Email address <Google E-Mail address>
Link status not linked

Florianschmidtwelzow (talkcontribs)

Hello! Thanks for testing! I will merge the patch soon into the repository :)

Actually the Extension doesn't look at the right's to create a new account, so you can ever create a new account, if you log in with Google. Do you want to change the behavior? That you can only create an account, if the user has a permission for that (createaccount right)?

89.0.29.169 (talkcontribs)

so far so good but a new account is never created by using GoogleLogin. What does the infomation "Link status not linked" says?
IMHO the Google Account / Google Authorisation is never linked to a valid or new created username.
Keep in mind that a new user is never created during the Google Login process into the wiki!

Florianschmidtwelzow (talkcontribs)

Hello! That's right :) Maybe a short overview, how the extension work:

At installation there will be created a new database table which stores only a google id and an id of a wiki account. If a user login with Google Login, the extension looks, if the google id has a wiki account id stored in this table. If not, the user becomes the screen to create a new wiki account (the real name and th enickname of Google account are name suggestions, but the user can choose his own name, too). If the user want create a new account he has the link status "not linked", because there is no wiki account to his google id.

It's possible to autocreate a user, yes, but only, if the google nickname is free. If you fill a bug into bugzilla.wikimedia.org i will be work on it to create the possibility to configure an autocreation of accounts.

So for now, the user must create an account by himself (if createaccount right is not given to unregistered users then only via the GoogleLogin extension).

87.78.35.128 (talkcontribs)

> So for now, the user must create an account by himself (if createaccount right is not given to unregistered users then only via the GoogleLogin extension).

But autocreating of a new account via GoogleLogin extension doesn't work for me. Eihter it end up in the state "Lnk statsu not linked" or the GoogleLoogin says user already in use. But in general a new user is still not created by GoogleLogin extension on my MW installation.
If I get it right the best would be to raise a ticket on bugzilla as feature request of account autocreation.

Florianschmidtwelzow (talkcontribs)

> If I get it right the best would be to raise a ticket on bugzilla as feature request of account autocreation.

In generally: yes :)

> Eihter it end up in the state "Lnk statsu not linked" or the GoogleLoogin says user already in use.

If i understand this right, you want to try to recreate user "Mike" (which is already a mediawiki user)? If it is so, then you must login into the user first (normally with username and password) and then go to /Special:GoogleLogin, login with your Google Account and simply click "link google with wiki account". After this process you can login with the "Login with Google" button :)

Florianschmidtwelzow (talkcontribs)

P.S.: Is there a reason why you set your article path to index.php?title=$1 ??? This seems to is the problem why the Create of an account won't work :/ I'm working on it, but if you haven't a good reason why to set $wgArticlePath, then maybe you can remove it :D

Or, if you don't set it manually, then you can change it to "$wgScript/$1". In my tests, then all works fine.

Florianschmidtwelzow (talkcontribs)

So, hello again! :) Can you please load this file and replace it with includes/specials/SpecialGoogleLogin.php? Can you then please test again?

Thanks again for your patient! :)

93.159.254.162 (talkcontribs)

Hi,
I'm not lost but we moved to our new home at the weekend so very little sparetime for this activities.
But yeah, I've tested the new SpecialGoogleLogin.php and it works excellent. First I was able to create a new account (without create account rights) Wiki account by choosing a new user name. The new account was linked directly to my Google account. Great!
Afterwards I've unlinked the new user account and linked my Google account to an existing useraccount without any problem.
So from myside the extension is now usable and working fine so that I'll release the Login for new users today.
Regarding $wgArticlePath:
I didn't set something like that. The only fault in my point of view for your documentation is that AUTHORIZED REDIRECT URI must be set in this way http://domain.tld/index.php?title=Special:GoogleLogin otherwise if I use your example http://domain.tld/index.php/Special:GoogleLogin I get the error that the requesting domain doesn't match. If other users reports problems to me I'll keep you informed!

Thanks again for your quick and uncomplicated support. I wish you good look with this nice and useful MW extension!

Florianschmidtwelzow (talkcontribs)

Big thanks for your reply! The change is now merged into the repository, just for information :)

I think you know, but only for information: You can link your Google Login to an existing account without creating a new one :)

If you found some other problems, feel free to start a new thread.

89.0.29.169 (talkcontribs)

Regarding create account rights. No, I don't like to change the behaviour in general. I've in mind from the past that OpenID extensions creates a user automatically based on the Google account nickname. A password isn't stored within the MW. So that you are only able to login to MW if the extension openId is activated.
As OpenID is not longer recommended by Google new user authentifications must be switched over to OAuth. That's the reason for using GoogleLogin as it is the best alternative I've seen so far with a very active maintenance. :-)