Reputation: 2311
I have been developing a desktop application in C#(WPF) using Google+ APIs.It's a simple application that provides a login page for Googleplus+, when user enters credentials & consents the application's permission request,it retrieve and display the User's profile information.
Using the Google+ API I am able to retrieve the User's Profile information from Google+. But when I exit and open the application again, instead of login page it is going directly to the "Request for approval" page.
The problem is in Internet Explorer,as it enables the "Stay signed in" option by default.I want to logout the user automatically every time the application closes.
After searching in google, I found by navigating the browser to this "https://accounts.google.com/Logout?&continue=http://www.google.com/" logout the user.
Is there any API in google+ for logging out programmatically the user or is this the only way?
Upvotes: 2
Views: 6045
Reputation: 21
Google+ do not provide any api for signout or rather they didnt worked for me.
i found out other solution which i am mentioning here try this out. it worked out for me.
https://www.google.com/accounts/Logout?continue=https://appengine.google.com/_ah/logout?continue='your site url'
Upvotes: 2
Reputation: 9213
Google+ API doesnt provide any methods to log a user out of the Google's single sign-on, because it shouldnt be handled at the layer of Google+ API.
Google+ authorize and authenticate you with an access token that is gathered by your auth flow that needs a signed-in Google account. If you want to log the user out of Google network, you should redirect him/her to
https://accounts.google.com/Logout?&continue=[nextUrl]
or clear all of the cookies on launch or shutdown.
If you want to revoke the access token you retrieved for your application, you should use https://developers.google.com/accounts/docs/OAuth2WebServer#tokenrevoke that will expire the existing access token.
Upvotes: 7