Is there a deauthorize callback for Google OAuth2?

Viewed 1561

My PHP app allows user sign in via both Facebook and Google which work great, but I'd also like to know when a user revokes/deauthorizes access.

For Facebook, it's easy to specify a deauthorization callback URL under Advanced Settings which will be called by Facebook with the user's Facebook ID. For Google, I found authentication guide which talks about revoking access but doesn't mention a callback.

How do I get Google to tell my app when a user revokes access? (i.e., by clicking a "Revoke Access" button here)

1 Answers

There is no logout callback as such, but you may include something like

<script type="text/javascript" 
    src="https://mail.google.com/mail/u/0/?logout&hl=en" />

in your logout page, to ensure the user, provided is still logged in with google, is also logged out there, when logging out of your app.

Related