API: Added OAuth revoke, adding documentation to parameters

This commit is contained in:
Michael 2021-06-16 19:24:44 +00:00
parent ead0cf370a
commit 5e22704f7e
3 changed files with 30 additions and 10 deletions

View file

@ -37,11 +37,12 @@ class Token extends BaseApi
public static function post(array $parameters = [])
{
$request = self::getRequest([
'grant_type' => '',
'code' => '',
'redirect_uri' => '',
'client_id' => '',
'client_secret' => '',
'client_id' => '', // Client ID, obtained during app registration
'client_secret' => '', // Client secret, obtained during app registration
'redirect_uri' => '', // Set a URI to redirect the user to. If this parameter is set to "urn:ietf:wg:oauth:2.0:oob" then the token will be shown instead. Must match one of the redirect URIs declared during app registration.
'scope' => 'read', // List of requested OAuth scopes, separated by spaces. Must be a subset of scopes declared during app registration. If not provided, defaults to "read".
'code' => '', // A user authorization code, obtained via /oauth/authorize
'grant_type' => '', // Set equal to "authorization_code" if code is provided in order to gain user-level access. Otherwise, set equal to "client_credentials" to obtain app-level access only.
]);
// AndStatus transmits the client data in the AUTHORIZATION header field, see https://github.com/andstatus/andstatus/issues/530