Topic on Extension talk:OpenID Connect

keeps asking for login even after successful authentication

9
Summary by Cindy.cicalese

Reinstalling the extension fixed the problem.

Harish mw (talkcontribs)

Hi,

I am trying to use google as the authentication provider. Even after the successful authentication, i do not see logged in status at the top of the page. And its keep asking for the login.

versions i use are,

MediaWiki 1.31.0
OpenID Connect 4.1 (baea47f)

Settings that i use to configure are,

wfLoadExtension( 'PluggableAuth' );

$wgPluggableAuth_ButtonLabel = "Login using Google Id";

$wgPluggableAuth_EnableLocalLogin = false;

$wgPluggableAuth_Class = "OpenIDConnect";

wfLoadExtension( 'OpenIDConnect' );

$wgOpenIDConnect_Config['https://accounts.google.com'] = [

    'clientID' => '<id>.apps.googleusercontent.com',

    'clientsecret' => '<secret>',

    'scope' => [ 'openid', 'profile', 'email' ]

];

$wgOpenIDConnect_UseEmailNameAsUserName = true;

$wgOpenIDConnect_MigrateUsersByUserName = true;

$wgOpenIDConnect_MigrateUsersByEmail = true;

$wgOpenIDConnect_ForceLogout = false;

What i think is wrong is,

My url structure is like this,

http://example.org/w/index.php?title=Page_title

But i read from the known bug section that it may not work for openid connect. But there is no clear guidance on how to achieve shorturl.

Please help! Thanks.

Cindy.cicalese (talkcontribs)
Harish mw (talkcontribs)

Hi Cindy,

I used the patch you provided but still the login state remains "Not loggedin"

My home page url is ,

https://www..domain.com/wiki/index.php/Main_Page

I set the redirect url in google client as,

https://www.domain.com/wiki/index.php/Special:PluggableAuthLogin

When i click on the login button it takes me to google login page and ieverything works fine but after google login i get this page, (which is empty and login state is still not loggedin).

https://www.domain.com/wiki/index.php/Special:PluggableAuthLogin?state=e43e1fa3162ba32bbcc7709122cfd081&code=4/fQAzWMIvBIeO9gUDXCDfUjoPcA9JJ72l1eMBzVDOmTe6WswQe7r6BG2lShBIJolseRrqSkzFUOYlA7BPBjQou4g&scope=https://www.googleapis.com/auth/userinfo.email+https://www.googleapis.com/auth/plus.me+https://www.googleapis.com/auth/userinfo.profile&authuser=0&session_state=036a6db7a7a2a42a08d2c16a5de79d5efb680e96..cb20&prompt=none

I don't know what wrong am i doing.

Regards,

Harish Kumar

Cindy.cicalese (talkcontribs)
Cindy.cicalese (talkcontribs)
Harish mw (talkcontribs)

Hi Cindy,

I enabled the debug log and i saw this error message,

[DBQuery] SQL ERROR: Table 'domain_c.wiki_openid_connect' doesn't exist (domain.com.mysql)

[OpenID Connect] Wikimedia\Rdbms\DBQueryError: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading?

Query: SELECT  user_id,user_name  FROM `wiki_user` JOIN `wiki_openid_connect` ON ((user_id=oidc_user))   WHERE oidc_subject = '112483205729160165553' AND oidc_issuer = 'https://accounts.google.com'  LIMIT 1  

Function: OpenIDConnect::findUser

Error: 1146 Table 'domain_c.wiki_openid_connect' doesn't exist (domain.com.mysql)

Based on the error message above it looks like there are no database tables created. So i started reinstalling mediawiki from the beginning. But during "Upgrading existing installation" step i got following error,

Creating openid_connect table ...

An error occurred:

Could not open "/customers/0/5/0/domain.com/httpd.www/wiki/extensions/OpenIDConnect/sql/mysql/AddTable.sql"

I checked in the extentions directory under OpenIDConnect/sql/... There is no directory called mysql.

OpenIDConnect extension i downloaded also does not have those file AddTable.sql.

Please let me know if my understanding is wrong. Why the download does not have the file AddTable.sql?

Cindy.cicalese (talkcontribs)

The first error was caused by not running the update.php maintenance script. The second error is odd, almost like you are running the wrong version of the update code. Whatever the cause, that problem should be fixed if you upgrade to version 5.0 of the extension or master from git. If you use Extension Distributor, get the 1.32 version, not the 1.31 version. It will work with MediaWiki 1.31, regardless.

Harish mw (talkcontribs)

Hi Cindy,

I reinstalled the extension from the master version and now everything works fine :-)

Thank you..

Cindy.cicalese (talkcontribs)

Excellent!