wikibase-edit icon indicating copy to clipboard operation
wikibase-edit copied to clipboard

Allow passing in direct Oauth2 tokens

Open PythonCoderAS opened this issue 2 years ago • 2 comments

I am using frontend JS to authenticate with OAuth2 via PKCE, and so I can't use the existing oauth options. I am able to get the bearer token and make authenticated requests with that, but I do not know how to supply the bearer token with this library. I understand this will have to be per-request but there still is no option for that.

PythonCoderAS avatar Nov 22 '22 11:11 PythonCoderAS

I could try to have a look at it. Could you point to documentation on how to get such an OAuth2 token? Do you use it on wikidata.org or on another Wikibase instance with a particular OAuth extension?

maxlath avatar Nov 22 '22 12:11 maxlath

Here's an example: https://github.com/wikimedia/apiclient-wiki/blob/master/js/apiclient.js. I also have my own implementation: https://github.com/PythonCoderAS/wikidata-animanga-db-matcher-frontend/blob/master/src/common/oauth.ts

And yes, I'm trying to use it on Wikidata.

PythonCoderAS avatar Nov 23 '22 04:11 PythonCoderAS