I am using api.php?action=login... I run the login command from my java class and it returns successfully. I create the cookies manually as suggested in http://www.mediawiki.org/wiki/API:Login. Within firefox I do show cookies and they are listed under localhost.
Immediately after the login statement I run an api query with "list=categorymembers."
If I have $wgGroupPermissions['*']['read'= false;, I receive an error.
So my login does not seem to be working.
Thanks for any assistance.
Mary Beebe
2009/6/9 Beebe, Mary J BeebeM@battelle.org:
I am using api.php?action=login… I run the login command from my java class and it returns successfully. I create the cookies manually as suggested in http://www.mediawiki.org/wiki/API:Login. Within firefox I do show cookies and they are listed under localhost.
Immediately after the login statement I run an api query with “list=categorymembers.”
If I have $wgGroupPermissions['*']['read'= false;, I receive an error.
So my login does not seem to be working.
Thanks for any assistance.
Can you provide more details? Which wiki are you trying to log into? How are you building the cookies? If you run a meta=userinfo query after logging in, what does it return?
Roan Kattouw (Catrope)
Beebe, Mary J wrote:
I am using api.php?action=login… I run the login command from my java class and it returns successfully. I create the cookies manually as suggested in http://www.mediawiki.org/wiki/API:Login. Within firefox I do show cookies and they are listed under localhost.
Immediately after the login statement I run an api query with “list=categorymembers.”
If I have $wgGroupPermissions['*']['read'= false;, I receive an error.
So my login does not seem to be working.
Thanks for any assistance.
**/Mary Beebe/**
I assume the missing ] is a typo. Does the user trying to log in have the read right from another group? Ie. does $wgGroupPermissions['user']['read'] = true; ?
Yes they do. I am actually logging in as a sysop for test purposes.
I do not think that the api is reading the cookies.
Mary Beebe
-----Original Message----- From: mediawiki-api-bounces@lists.wikimedia.org [mailto:mediawiki-api-bounces@lists.wikimedia.org] On Behalf Of Platonides Sent: Tuesday, June 09, 2009 12:54 PM To: MediaWiki API announcements & discussion Subject: Re: [Mediawiki-api] login with api.
Beebe, Mary J wrote:
I am using api.php?action=login... I run the login command from my java class and it returns successfully. I create the cookies manually as suggested in http://www.mediawiki.org/wiki/API:Login. Within firefox I do show cookies and they are listed under localhost.
Immediately after the login statement I run an api query with "list=categorymembers."
If I have $wgGroupPermissions['*']['read'] = false;, I receive an error.
So my login does not seem to be working.
Thanks for any assistance.
**/Mary Beebe/**
I assume the missing ] is a typo. Does the user trying to log in have the read right from another group? Ie. does $wgGroupPermissions['user']['read'] = true; ?
_______________________________________________ Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
2009/6/9 Beebe, Mary J BeebeM@battelle.org:
Yes they do. I am actually logging in as a sysop for test purposes.
I do not think that the api is reading the cookies.
To verify, please run a meta=userinfo query right after logging in and post the results here.
Roan Kattouw (Catrope)
Great idea - I ran that manually and it seems to be what I need. I am now trying to put it into my code, but keep getting distracted. Platonides said the same thing.
Thanks,
Mary Beebe
-----Original Message----- From: mediawiki-api-bounces@lists.wikimedia.org [mailto:mediawiki-api-bounces@lists.wikimedia.org] On Behalf Of Roan Kattouw Sent: Tuesday, June 09, 2009 1:55 PM To: MediaWiki API announcements & discussion Subject: Re: [Mediawiki-api] login with api.
2009/6/9 Beebe, Mary J BeebeM@battelle.org:
Yes they do. I am actually logging in as a sysop for test purposes.
I do not think that the api is reading the cookies.
To verify, please run a meta=userinfo query right after logging in and post the results here.
Roan Kattouw (Catrope)
_______________________________________________ Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
It is showing anonymous: <userinfo id="0" name="131.167.170.97" anon="" />
In http://www.mediawiki.org/wiki/API:Login
Under "Constructing Cookies Manually" it says "A successful action=login request will set the right cookies." But I am trying to construct my own cookies following the information below that.
I have these cookies: defaultdb_session defaultdbToken defaultdbUserID defaultdbUserName
The cookies are under localhost. Could that be a problem?
I also see: "the cookie set by this request must be passed." I am not passing anything.
Mary Beebe
-----Original Message----- From: mediawiki-api-bounces@lists.wikimedia.org [mailto:mediawiki-api-bounces@lists.wikimedia.org] On Behalf Of Beebe, Mary J Sent: Tuesday, June 09, 2009 2:01 PM To: MediaWiki API announcements & discussion Subject: Re: [Mediawiki-api] login with api.
Great idea - I ran that manually and it seems to be what I need. I am now trying to put it into my code, but keep getting distracted. Platonides said the same thing.
Thanks,
Mary Beebe
-----Original Message----- From: mediawiki-api-bounces@lists.wikimedia.org [mailto:mediawiki-api-bounces@lists.wikimedia.org] On Behalf Of Roan Kattouw Sent: Tuesday, June 09, 2009 1:55 PM To: MediaWiki API announcements & discussion Subject: Re: [Mediawiki-api] login with api.
2009/6/9 Beebe, Mary J BeebeM@battelle.org:
Yes they do. I am actually logging in as a sysop for test purposes.
I do not think that the api is reading the cookies.
To verify, please run a meta=userinfo query right after logging in and post the results here.
Roan Kattouw (Catrope)
_______________________________________________ Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
_______________________________________________ Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
2009/6/9 Beebe, Mary J BeebeM@battelle.org:
It is showing anonymous:
<userinfo id="0" name="131.167.170.97" anon="" />
In http://www.mediawiki.org/wiki/API:Login
Under "Constructing Cookies Manually" it says "A successful action=login request will set the right cookies." But I am trying to construct my own cookies following the information below that.
I have these cookies: defaultdb_session defaultdbToken defaultdbUserID defaultdbUserName
The cookies are under localhost. Could that be a problem?
I also see: "the cookie set by this request must be passed." I am not passing anything.
What you have to do is get the cookies that action=login is giving you and send them back as part of your HTTP request on all subsequent queries. If you're somehow unable to grab the cookies, you can build them manually as outlined in the docs, but you still have to include them in every HTTP request. The framework you're using to do HTTP requests probably has a way to set cookies; for instance, in Snoopy (an HTTP framework for PHP), it's as simple as calling $snoopy->setCookies(); after the login request, which automatically grabs the cookies received in the previous request and passes them in every subsequent request. Your framework probably has a setCookie() or similarly-named function as well.
Roan Kattouw (Catrope)
mediawiki-api@lists.wikimedia.org