revokeToken method

Future<OAuth2Response> revokeToken(
  1. AccessTokenResponse tknResp, {
  2. String? clientId,
  3. String? clientSecret,
  4. dynamic httpClient,
  5. Map<String, dynamic>? params,
})

Revokes both the Access and the Refresh tokens in the provided tknResp

Implementation

Future<OAuth2Response> revokeToken(
  AccessTokenResponse tknResp, {
  String? clientId,
  String? clientSecret,
  httpClient,
  Map<String, dynamic>? params,
}) async {
  var tokenRevocationResp = await revokeAccessToken(tknResp,
      clientId: clientId,
      clientSecret: clientSecret,
      httpClient: httpClient,
      params: params);
  if (tokenRevocationResp.isValid()) {
    tokenRevocationResp = await revokeRefreshToken(tknResp,
        clientId: clientId,
        clientSecret: clientSecret,
        httpClient: httpClient,
        params: params);
  }

  return tokenRevocationResp;
}