Update Extension:OAuth with documentation for new endpoints added for T257982
Notes
List clients
GET /oauth2/client
Example: curl -H "Accept: application/json" --cookie "<session cookie value>" <scheme/host/port/scriptpath>/rest.php/oauth2/client?oauth_version=2
Query param: oauth_version, can be 1 or 2, defaults to 2
Response example:
{ "clients": [ { "client_key": "xxx", "name": "TestFromCurl1807", "version": "1.0", "email": "admin@example.com", "callback_url": "http://default.web.mw.localhost:8080/mediawiki/", "scopes": [ "authonly" ], "registration": "20200818230806", "stage": 0, "oauth_version": 2, "description": "foo", "allowed_grants": [ "authorization_code" ], "registration_formatted": "23:08, 18 August 2020" } ], "total": 1 }
Reset secret
POST /oauth2/client/{client ID}/reset_secret
Example: curl -H "Accept: application/json" --cookie "<cookie>" -X POST -F reason=<reason> <scheme/host/port/scriptpath>/rest.php/oauth2/client/<client id>/reset_secret
Response example:
{ "name": "TestFromCurl1807", "client_key": "xxx", "secret": "xxx" }
Create client
POST /oauth2/client
Example: curl -H "Accept: application/json" --cookie "<cookie>" -X POST -F name=<name> -F description=<description> -F email=<email> -F is_confidential=<0 or 1> -F grant_types=<grant_types> -F scopes=<scopes> -F callback_url=<callback url> <scheme/host/port/scriptpath>/rest.php/oauth2/client
Response example:
{ "name": "TestFromCurl1807", "client_key": "xxx", "secret": "xxx" }