Reputation: 5563
I use Google oAuth to login my website. This is perfectly works fine for sign in. But it doesn't work for logout.
I do below,
When user does below action google doesn't invalidates the token instead it sends success response.
When the user closes the browser and come back then the token invalidated and my system doesn't allow. But without closing the browser it doesn't work
Upvotes: 1
Views: 1699
Reputation: 1591
This is the expected behavior. If user is logging out of the google it will not logout from your application as well. However, there is a work around if you want to logout user from your application and want google to be also logged out. You just have to clear all the cookies from the browser programatically OR you could dynamically build the logout url from one of their Google services logout button, and then invoke that using an img element or a script tag in your application.
<script type="text/javascript"
src="https://mail.google.com/mail/u/0/?logout&hl=en" />
OR
<img src="https://mail.google.com/mail/u/0/?logout&hl=en" />
OR
window.location = "https://mail.google.com/mail/u/0/?logout&hl=en";
Upvotes: 1