The documentation for API:Login http://www.mediawiki.org/wiki/API:Login is not elaborate enough and I find it confusing. I don't know whether I am the only one. This is the statement in particular that I am finding difficult to comprehend.
CentralAuth SUL Login ... Now you have to parse the cookie by looking for the centralauth_ cookies and adding additional entries for all other wikis that centralauth covers in your setup.
The cookies I get when I log in (after I get a success message) is like this. First, I do not understand why the domains for centralauth cookies is not having the language code (in this case 'en'). I tried manually changing it to en.wikipedia.org but that did not help. Second, I am not sure whether I create new cookies myself and give the names as enwiki_User, enwiki_Token and enwiki_Session and then copy the domain and values.
"Domain:en.wikipedia.org, Name:enwiki_session, Value:a645f734457a6dc84071c76920f49d17" "Domain:en.wikipedia.org, Name:enwikiUserID, Value:1668905" "Domain:en.wikipedia.org, Name:enwikiUserName, Value:Sreejithk2000" "Domain:.wikipedia.org, Name:centralauth_User, Value:Sreejithk2000" "Domain:.wikipedia.org, Name:centralauth_Token, Value:10818a0450a622c4b3ca32e25a73df54" "Domain:.wikipedia.org, Name:centralauth_Session, Value:aa05490f4be76d3be15641e71531bcc5"
Can someone elaborate on the next steps on the API portal or reply back to this email?
Quite surprisingly, I pointed my api to commons and all the Domains now gives the complete domain (commons.wikipedia.org) and I can get an edit token with these cookies.
Thanks, Sreejith K.
2011/4/14 Sreejith K. sreejithk2000@gmail.com:
The documentation for API:Login is not elaborate enough and I find it confusing. I don't know whether I am the only one. This is the statement in particular that I am finding difficult to comprehend.
CentralAuth SUL Login
... Now you have to parse the cookie by looking for the centralauth_ cookies and adding additional entries for all other wikis that centralauth covers in your setup. The cookies I get when I log in (after I get a success message) is like this. First, I do not understand why the domains for centralauth cookies is not having the language code (in this case 'en').
That's intentional, so you can have one cookie for all *.wikipedia.org subdomains.
I tried manually changing it to en.wikipedia.org but that did not help.
Don't.
Second, I am not sure whether I create new cookies myself and give the names as enwiki_User, enwiki_Token and enwiki_Session and then copy the domain and values.
No, you just need to save these cookies and pass them back in subsequent requests just like the other cookies. I agree that the manual text suggests something else.
Roan Kattouw (Catrope)
Sreejith K. wrote:
The documentation for API:Login http://www.mediawiki.org/wiki/API:Login is not elaborate enough and I find it confusing. I don't know whether I am the only one. This is the statement in particular that I am finding difficult to comprehend.
CentralAuth SUL Login
... Now you have to parse the cookie by looking for the centralauth_ cookies and adding additional entries for all other wikis that centralauth covers in your setup.
You can use all the cookies centralauth_User, centralauth_Token, centralauth_Session to all the WMF domains. They will automatically log you in and provide the <lang>wiki_session, <lang>wikiUserID (which you then need to treat the normal way).
Alternatively, you can also log into the other domains the normal way and not make cehtralauth_* cookies "global".
mediawiki-api@lists.wikimedia.org