revokeTokenWithHttpInfo method

Future<Response> revokeTokenWithHttpInfo(
  1. String token, {
  2. String? clientId,
})

Token revocation

Revokes an access or refresh token. Per RFC 7009, always returns 200 OK regardless of token validity.

Note: This method returns the HTTP Response.

Parameters:

  • String token (required): The token to revoke

  • String clientId: The client identifier

Implementation

Future<Response> revokeTokenWithHttpInfo(String token, { String? clientId, }) async {
  // ignore: prefer_const_declarations
  final path = r'/oauth/revoke';

  // ignore: prefer_final_locals
  Object? postBody;

  final queryParams = <QueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

  const contentTypes = <String>['application/x-www-form-urlencoded'];

  if (token != null) {
    formParams[r'token'] = parameterToString(token);
  }
  if (clientId != null) {
    formParams[r'client_id'] = parameterToString(clientId);
  }

  return apiClient.invokeAPI(
    path,
    'POST',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes.first,
  );
}