Topic on Extension talk:PluggableAuth

API clientlogin with PluggableAuth

4
Drcnyc (talkcontribs)

I am trying to log in to my private wiki using the clientlogin API from a linux-based IoT terminal which displays pages from the wiki that require authentication. I'm able to get the login token by posting "action=query&meta=tokens&type=login&format=json" to the API as specified in the API docs, but when I attempt to post "action=login&username=XX&password=XX&domain=XX&logintoken=XX&loginreturnurl=XX&format=json" to the API, the post is successful but I get [status: "FAIL", message: "The supplied credentials could not be authenticated.", messagecode: "authmanager-authn-no-primary"] in the response.

After doing some digging, it appears that this either has to do with PluggabeAuth removing the primary auth manager in $wgAuthManagerAutoConfig (as done in /includes/PluggableAuthHooks.php) or that perhaps PluggableAuth is serving as primary manager but turning down the request. When I run "action=query&meta=authmanagerinfo&amirequestsfor=login&format=json" through the API it shows that PluggableAuth has an additional field "pluggableauthlogin", which looks to be the login button, but I'm wondering if I somehow need to pass this as a parameter for the API login to work?

Any help would be greatly appreciated, as I'm running out of troubleshooting ideas here.

Cindy.cicalese (talkcontribs)
Drcnyc (talkcontribs)

Thank you - the bot login worked! But the issue I am now facing is that a bot is limited to accessing wiki pages via api.php (action=parse), and it doesn't appear that there is a way for a bot to access the "full" HTML pages via index.php as they would normally appear in a browser when accessing the wiki. The parse method only returns stripped down versions of pages, with no formatting/css, links and images not working, etc. What I need is the ability to access wiki pages via index.php so that I can get the full interactive experience for wiki pages on the IoT terminal. I believe the only way to do this would be a full login via action=clientlogin vs a bot login via action=login. Any ideas on how I can accomplish this? Can I login via action=clientlogin using a local account if PluggableAuth is enabled?

Cindy.cicalese (talkcontribs)

Unfortunately, action=clientlogin will not work with PluggableAuth. It's been a while since I've looked at it, but I believe it has to do with the way that most PluggableAuth authentication plugins interact with an external identity provider with redirects to the identity provider and then back to the wiki.

Reply to "API clientlogin with PluggableAuth"