I am trying to run the socialauth grails demo from this link. For this, I have registered my app with domain http://localhost:8080/appname
in the developer.facebook.com site. The login part is successfull. Unfortunately I am unable to logout. Here is my
SocialAuthController:
package org.brickred
import org.brickred.socialauth.SocialAuthManager
import org.codehaus.groovy.grails.web.pages.ext.jsp.GroovyPagesPageContext
import de.deltatree.social.web.filter.api.SASFHelper
import de.deltatree.social.web.filter.api.SASFStaticHelper
class SocialAuthController {
def index = {
println "id:::"+params.id;
redirect(uri: "/SAF/SocialAuth?id=${params.id}")
}
def signout = {
SASFHelper helper = SASFStaticHelper.getHelper(request)
SocialAuthManager socialAuthManager
if(helper!=null){
socialAuthManager = helper.getAuthManager()
if(socialAuthManager != null){
socialAuthManager.disconnectProvider(params.id)
}else{
flash.message = "Unable to logout from "+params.id
}
}else{
flash.message = "Unable to logout from "+params.id
}
redirect(uri: "/index.gsp")
}
}
Which is same as the demo link as given above. When I debug it from the STS IDE, in the line:
socialAuthManager.disconnectProvider(params.id)
It returns false.
As per the javadoc it says that:
/**
* It disconnects with provider
*
* @param id
* the provider id
* @return True if provider is disconnected or false if not.
*/
public boolean disconnectProvider(final String id) {
if (providersMap.get(id) != null) {
AuthProvider p = providersMap.get(id);
p.logout();
providersMap.remove(id);
return true;
}
return false;
}
Frankly to mention, the api has good features, but it is lacking a robust set of tutorials/online resources.So can anyone guess what is going on with my code??
Also if someone knows some more resources regarding the api,apart from those given in code.google.com, then kindly mention it here.