Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 592 Vote(s) - 3.53 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Programmatically logout OAuth Connector in Drupal 7

#1
I am using [OAuth Connector][1] 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?


[1]:

[To see links please register here]

Reply

#2
If I understand your question correctly, you can just call `user_logout()` to programmatically logout an authenticated user.

This is possible because the [Connector](

[To see links please register here]

) module (upon which [OAuth Connector](

[To see links please register here]

) is based) incorporates `hook_user_logout()` to propagate the logout call to the OAuth provider.

Hopefully this answers your question?

Note: is there a specific reason why you aren't using the more popular (and stable) [OAuth](

[To see links please register here]

) module?
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through