def revoke_token(self):
self.clean_error()<EOL>try:<EOL><INDENT>url = self.get_url(Constants.TOKEN_REVOKE_URL)<EOL>headers = self.get_authorized_headers(bearer=False)<EOL>data = {<EOL>'<STR_LIT>': self.access_token,<EOL>}<EOL>response = requests.post(url, headers=headers, json=data)<EOL>if response.status_code == <NUM_LIT:200>:<EOL><INDENT>self.access_token = None<EOL>self.refresh_token = None<EOL>self.expiration = None<EOL>return True<EOL><DEDENT>else:<EOL><INDENT>self.error = str(response.status_code)<EOL>self.error_description = self.extract_error_message_from_response(response)<EOL>return False<EOL><DEDENT><DEDENT>except Exception as e:<EOL><INDENT>self.error = <NUM_LIT><EOL>self.error_description = e.args[<NUM_LIT:0>]<EOL>return False<EOL><DEDENT>
Revokes an access token and refresh token pair.

See https://developers.onelogin.com/api-docs/1/oauth20-tokens/revoke-tokens Revoke Tokens documentation