Closed GoogleCodeExporter closed 8 years ago
Please also refer to
https://code.google.com/p/socialauth/issues/detail?id=259&can=1&q=logout&sort=mo
dified&colspec=ID%20Type%20Status%20Priority%20Milestone%20Owner%20Summary%20Mod
ified
The problem here is that suppose a user accessed my website giving his
facebook credentials and login to my web application
now if suppose some other user access the website again and use signup
using his facebook it should prompt him to the access page again .but
currently it simply login to the application using the old user login
,which is a big security risk .
Original comment by manish.k...@ihg.com
on 8 Jul 2013 at 4:45
Calling disconnectProvider() of SocialAuthManager only disconnect the provider
from manager. It 'll not disconnect the Facebook session. And also please make
sure you are clearing your session too after calling disconnect if you want to
make user logout from your application.
If other user uses the application from same machine with same browser in that
case Facebook session will be available in that browser so he'll be login with
the previous user account.
Original comment by tarun.na...@3pillarglobal.com
on 11 Jul 2013 at 2:21
Hi Manish
I hope it is clear to you. Please open a new issue if you have any other query
regarding this.
Regards
Tarun
Original comment by tarun.na...@3pillarglobal.com
on 23 Jul 2013 at 11:51
Hi Tarun,
I am also facing the same issue. Once we are logging into facebook in one
browser, we are not able to logout. I think facebook is maintaining session
with browser that making the problem.
Please respond if an issue is reported or i need to open one.
Original comment by narsi.na...@gmail.com
on 2 Nov 2013 at 3:00
Can you please read the comment#2 carefully.
SocialAuth only provide logout functionality from socialauth manager not from
the provider itself.
Original comment by tarun.na...@3pillarglobal.com
on 5 Nov 2013 at 5:17
Narsi...
Given below is grails code snippet which I use to logout from Facebook as well.
As Tarun said, SocialAuth API doesn't provide a way to logout from facebook,
and you will have to explicitly call facebook(redirect) to logout.
Given below code will give you an idea how it be done.
// Remove the social authentication provider
SASFHelper helper = SASFStaticHelper.getHelper(getHttpRequest())
if(helper != null) {
SocialAuthManager socialAuthManager = helper.getAuthManager()
if(socialAuthManager != null){
socialAuthManager.disconnectProvider(socialAuthManager.currentProviderId)
}
}
// Redirect user to social providers(e.g. facebook) for logout from their systems as well.
def logoutUrl = "https://www.facebook.com/logout.php?next=http://your_website.com&access_token=" + user.accessToken
def user = session.getAttribute('user')
// Make sure "your_website.com" is the same domain which you registered with facebook to generate key and secret
// Remove the user data from session.
session.user = null
redirect(url: logoutUrl)
// NOTE - Use your own way to get access token. Given below is example on how I store access token in user object at the time of facebook login
user.accessToken = sasHelper.getProvider().getAccessGrant().getKey()
Original comment by manish.k...@ihg.com
on 5 Nov 2013 at 5:35
Also, certain lines might not be needed for you(e.g clear the session) - I just
copied the code.
Also, you can get the access token from SASFHelper helper =
SASFStaticHelper.getHelper(getHttpRequest()) itself, no need to store access
token in session etc.
Original comment by manish.k...@ihg.com
on 5 Nov 2013 at 5:37
Original issue reported on code.google.com by
manish.k...@ihg.com
on 8 Jul 2013 at 4:40