-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hello,
The only CentralAuth cookies I'm getting from the 2nd response referred to at [0] has domain=.wikipedia.org, so the bot will be logged in on all wikipedia domains. However, this doesn't work for non-wikipedia projects. How should I get a cookie for those domains as well?
Thanks, - -Mike
[0] http://www.mediawiki.org/wiki/API:Login#Construct_cookies
On Sat, Jul 24, 2010 at 12:07:51PM -0300, Mike.lifeguard wrote:
The only CentralAuth cookies I'm getting from the 2nd response referred to at [0] has domain=.wikipedia.org, so the bot will be logged in on all wikipedia domains. However, this doesn't work for non-wikipedia projects.
The api on .wikipedia.org cannot set cookies on .wikimedia.org or other domains. In the normal login form, those cookies get set by the little icons for each project that are displayed on the login form.
How should I get a cookie for those domains as well?
I don't know whether it would work to just fake up identical cookies for the other domains, you could try it and find out. Or you might be able to use Special:AutoLogin in the same way the little icons do. But the easiest way would probably be to just do the API login on the other wiki to get the cookies in the normal manner. For humans it's annoying to have to put in your username and password multiple times, but for a bot it shouldn't be a big deal.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 10-07-24 05:27 PM, Brad Jorsch wrote:
How should I get a cookie for those domains as well?
I don't know whether it would work to just fake up identical cookies for the other domains, you could try it and find out.
I'd clone the cookie and alter the domain if I was confident it'd work. I imagine it probably doesn't though. I suppose I'll still try it at some point...
Or you might be able to use Special:AutoLogin in the same way the little icons do.
Is there an API module corresponding to Special:AutoLogin? If think there must not be, since it isn't mentioned on the API login page on mw.org
But the easiest way would probably be to just do the API login on the other wiki to get the cookies in the normal manner.
Yes, I can write a routine to log into other domains - but isn't the S in SUL "single"? I had hoped to avoid having to do that. Oh well
- -Mike
mediawiki-api@lists.wikimedia.org