I am using OAuth Connector module to authenticate a user from an external source. Each user on the external source has a corresponding Drupal user account.
After successful oath authentication, user is programmatically logged in with a matching Drupal user account using user_authenticate
and user_login_finalize
.
When the drupal user logs out, I want to revoke OAuth access programmatically in user_logout
.
But I could not find any logout/revoke/destroy/invalidate method in any of the OAuth classes.
What is the correct way to programmatically logout an authenticated OAuth user in Drupal 7?
P.S. I know the system i have mentioned above is very inconvenient and there are many better ways to share user accounts between sites but my question is limited to 'how to logout in Drupal 7 OAuth connector module'.
EDIT: If I clear the saved OAuth tokens is it similar to logging out? Can anyone shed more light on what all data is stored by OAuth module and how to clear it if there is no direct logout option?