Don't strip the last \ its part of a legacy validity check. Always pass
whatever you get back the way you for it.

On Sun, Feb 19, 2017 at 1:49 AM Michael <[email protected]> wrote:

> Sorry, if it turns out as a stupid mistake, but I am at the end of my own
> knowledge to solve this issue on my MediaWiki 1.28 installation:
>
>
>
> I am using a python3 script to 1) get the token, and 2) login via
> ‘clientlogin’, but I always receive the
>
> "error": {
>
>         "code": "badtoken",
>
>         "info": "Invalid token",
>
>
>
> The taken is coming from     'action': 'query',     'meta': 'tokens',
>     'type': 'login', and I strip the last ‘\’.
>
>
>
> This is my submission for Login:
>
> Type: <class 'urllib.request.Request'>
>
> Contents: {'_full_url': 'https://wiki.xxxxat.com/api.php',
> 'unredirected_hdrs': {}, '_tunnel_host': None, 'fragment': None, '_data':
> b'password=Lxxxxxxxx7&action=clientlogin&rememberMe=1&username=Admin&returnurl=https%3A%2F%
> 2Fwiki.xxxxat.com%2F&logintoken=8f2d58f9cc8336543c7f67cf8a5926d058a95ede%2B%5C&requestid=byMichael',
> 'origin_req_host': 'wiki.xxxxat.com', 'selector': '/api.php', 'headers':
> {'Content-type': 'application/x-www-form-urlencoded'}, 'type': 'https',
> 'unverifiable': False, 'host': 'wiki.xxxxat.com'}
>
>
>
> Following  the same procedure via ApiSandbox is working fine.
>
>
>
> Thank you for your help!
>
>
>
>
>
>
> _______________________________________________
> Mediawiki-api mailing list
> [email protected]
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
>
_______________________________________________
Mediawiki-api mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api

Reply via email to