Hello,
I am trying to write a Wikibase Integrator script to automate imports into my wikibase project. However I am having problems writing the log-in procedures. In the past I have used Wikibase Integrator to do something similar on Wikidata, for which the log-in procedures are simple since that site is the default for Wikibase Integrator.
In particular, it seems that the following code should suffice:
from wikibaseintegrator.wbi_config import config as wbi_config from wikibaseintegrator import wbi_login, datatypes, WikibaseIntegrator
wbi_config["WIKIBASE_URL"] = 'https://framenet-akkadian.wikibase.cloud' #My actual project login_instance = wbi_login.Clientlogin(user='USER', password=PASSWORD') wbi = WikibaseIntegrator(login=login_instance)
Where USER and PASSWORD are what I use to login to the project directly.
But I get the error: wikibaseintegrator.wbi_login.LoginError: Login failed (wrongpassword). Message: 'Incorrect username or password entered. Please try again.'
I do not understand what is wrong.
You appear to have a single quote at the end of your password but not the start of it, while the username has it at the start and the end. Not sure if that reflects the original, though.
The documentation also says you must change: mediawiki_api_url, mediawiki_rest_url or mediawiki_index_url for authentication https://github.com/LeMyst/WikibaseIntegrator/blob/master/README.md#wbi_login
None of these are WIKIBASE_URL, although this may be necessary as well for the actual edits.
Lastly, I would suggest using a bot password and the Login method rather than Client login as documented above. They can probably be obtained from https://framenet-akkadian.wikibase.cloud/wiki/Special:BotPasswords if logged in.
________________________________ From: Matthew Ong matthewcong@gmail.com Sent: Saturday, February 10, 2024 3:27:55 AM To: wikibase-cloud@lists.wikimedia.org wikibase-cloud@lists.wikimedia.org Subject: [Wikibase-cloud] Basic question about how to log in to wikibase-cloud project using Wikibase Integrator
Hello,
I am trying to write a Wikibase Integrator script to automate imports into my wikibase project. However I am having problems writing the log-in procedures. In the past I have used Wikibase Integrator to do something similar on Wikidata, for which the log-in procedures are simple since that site is the default for Wikibase Integrator.
In particular, it seems that the following code should suffice:
from wikibaseintegrator.wbi_config import config as wbi_config from wikibaseintegrator import wbi_login, datatypes, WikibaseIntegrator
wbi_config["WIKIBASE_URL"] = 'https://framenet-akkadian.wikibase.cloud' #My actual project login_instance = wbi_login.Clientlogin(user='USER', password=PASSWORD') wbi = WikibaseIntegrator(login=login_instance)
Where USER and PASSWORD are what I use to login to the project directly.
But I get the error: wikibaseintegrator.wbi_login.LoginError: Login failed (wrongpassword). Message: 'Incorrect username or password entered. Please try again.'
I do not understand what is wrong. _______________________________________________ Wikibase-cloud mailing list -- wikibase-cloud@lists.wikimedia.org List information: https://lists.wikimedia.org/postorius/lists/wikibase-cloud.lists.wikimedia.o...
Thank you. I will try following the login documentation. The quote errors are a result of my copy-paste here and were not in the original code.
In trying to use the Wikibase Integrator package to log in, I still am having problems despite following your advice. I first defined the various config values as the Integrator documentation suggests:
wbi_config["WIKIBASE_URL"] = 'https://framenet-akkadian.wikibase.cloud' wbi_config["MEDIAWIKI_INDEX_URL"] = 'https://framenet-akkadian.wikibase.cloud/w/api.php' wbi_config["MEDIAWIKI_API_URL"] = 'https://framenet-akkadian.wikibase.cloud/w/index.php' wbi_config["MEDIAWIKI_REST_URL"] = 'https://framenet-akkadian.wikibase.cloud/w/rest.php'
and then tried two ways of logging in. The first is the old way using a personal account:
login_instance = wbi_login.Clientlogin(user='XXX', password='XXX') wbi = WikibaseIntegrator(login=login_instance)
When I tried to follow the 'OAuth2' method and register an owner-only client on my wikibase-cloud project for Wikibase Integrator to use, the registration process does not seem to work. Clicking the 'Propose Consumer' button generates an error page (HTTP 500). I also for the sake of trying also did the same registration process on meta.wikimedia.org. I used the tokens there for the wbi_login's OAuth2 method:
login_instance = wbi_login.OAuth2(consumer_token='XXX', consumer_secret='XXX')
But it said 'authentication failed'.
So I still don't understand what is going wrong. Perhaps I am defining web_config's url settings wrong?
wikibase-cloud@lists.wikimedia.org