Created
March 25, 2015 17:21
-
-
Save yupadhyay/184a4fb965151fc06252 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Import | |
import org.osgi.framework.ServiceRegistration; | |
import org.apache.sling.auth.core.spi.AuthenticationHandler; | |
import org.apache.sling.auth.core.spi.DefaultAuthenticationFeedbackHandler; | |
//Your Custom Auth handler class | |
public class CustomAuthHandler extends DefaultAuthenticationFeedbackHandler implements AuthenticationHandler { | |
//All Your Logic | |
private ServiceRegistration loginModule; | |
//All Your Logic | |
@Activate | |
protected void activate(ComponentContext componentContext) { | |
context = componentContext; | |
this.loginModule = null; | |
try { | |
this.loginModule = CustomPluggableLoginModule.register(this, componentContext.getBundleContext()); | |
} catch (Throwable t) { | |
//Error handling | |
} | |
} | |
@Deactivate | |
protected void deactivate(@SuppressWarnings("unused") ComponentContext componentContext) { | |
if (loginModule != null) { | |
loginModule.unregister(); | |
loginModule = null; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment