Hi,
I'm trying to use the OAuth 2 extension included in the Wikibase 1.35 (docker-compose bundle, found here : github.com/wmde/wikibase-docker).
First, I've tried OAuth2, just with this url in my browser :"myWikiUrl"/w/rest.php/oauth2/resource/profile
And I've got this error :
"Notice: Key file "file://" permissions are not correct, recommend changing to 600 or 660 instead of 755 in /var/www/html/extensions/OAuth/vendor/league/oauth2-server/src/CryptKey.php on line 63 "
So, I've generated private and public keys, with :
openssl genrsa -out private.key 2048
openssl rsa -in private.key -pubout -out public.key
Then, I've added those parameters : $wgOAuth2PrivateKey and $wgOAuth2PublicKey , to the end of my LocalSettings.php file, and I've set them to my generated keys paths.
I "chmod 660", the keys and "chown" them to www-data:www-data .
The "key file" error disappear, but I still get an error.
Si, I've tried to authenticate with PostMan, with an OAuth 2 configuration : "Authorization Code" Grant type, a Callback URL, an Auth URL : "w/rest.php/oauth2/authorize" , an Access Token URL : "w/rest.php/oauth2/access_token", my Cliend ID and my Client Secret, and with the option "Client Authentication send as Basic Auth header".
The authentication was ok, but the access_token returned this error (same error if I used : "myWikiUrl"/w/rest.php/oauth2/resource/profile ) :
<br /> <b>Fatal error</b>: Method MediaWiki\Extensions\OAuth\Entity\AccessTokenEntity::__toString() must not throw an exception, caught ParseError: syntax error, unexpected 'Parser' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in <b>/var/www/html/extensions/OAuth/vendor/league/oauth2-server/src/ResponseTypes/BearerTokenResponse.php</b> on line <b>0</b><br />↵
I also follow this guide : https://api.wikimedia.org/wiki/Documentation/Getting_started/Authentication , but I still don't know what is not correct..
Thanks in advance