Class AbstractLoginModule

  • All Implemented Interfaces:
    javax.security.auth.spi.LoginModule
    Direct Known Subclasses:
    AbstractDatabaseLoginModule, LdapLoginModule, PropertyFileLoginModule

    public abstract class AbstractLoginModule
    extends java.lang.Object
    implements javax.security.auth.spi.LoginModule
    AbstractLoginModule Abstract base class for all LoginModules. Subclasses should just need to implement getUserInfo method.
    • Constructor Detail

      • AbstractLoginModule

        public AbstractLoginModule()
    • Method Detail

      • getUserInfo

        public abstract UserInfo getUserInfo​(java.lang.String username)
                                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getSubject

        public javax.security.auth.Subject getSubject()
      • setSubject

        public void setSubject​(javax.security.auth.Subject s)
      • getCallbackHandler

        public javax.security.auth.callback.CallbackHandler getCallbackHandler()
      • setCallbackHandler

        public void setCallbackHandler​(javax.security.auth.callback.CallbackHandler h)
      • isAuthenticated

        public boolean isAuthenticated()
      • isCommitted

        public boolean isCommitted()
      • setAuthenticated

        public void setAuthenticated​(boolean authState)
      • setCommitted

        public void setCommitted​(boolean commitState)
      • abort

        public boolean abort()
                      throws javax.security.auth.login.LoginException
        Specified by:
        abort in interface javax.security.auth.spi.LoginModule
        Throws:
        javax.security.auth.login.LoginException - if unable to abort
        See Also:
        LoginModule.abort()
      • commit

        public boolean commit()
                       throws javax.security.auth.login.LoginException
        Specified by:
        commit in interface javax.security.auth.spi.LoginModule
        Returns:
        true if committed, false if not (likely not authenticated)
        Throws:
        javax.security.auth.login.LoginException - if unable to commit
        See Also:
        LoginModule.commit()
      • configureCallbacks

        public javax.security.auth.callback.Callback[] configureCallbacks()
      • isIgnored

        public boolean isIgnored()
      • login

        public boolean login()
                      throws javax.security.auth.login.LoginException
        Specified by:
        login in interface javax.security.auth.spi.LoginModule
        Returns:
        true if is authenticated, false otherwise
        Throws:
        javax.security.auth.login.LoginException - if unable to login
        See Also:
        LoginModule.login()
      • logout

        public boolean logout()
                       throws javax.security.auth.login.LoginException
        Specified by:
        logout in interface javax.security.auth.spi.LoginModule
        Returns:
        true always
        Throws:
        javax.security.auth.login.LoginException - if unable to logout
        See Also:
        LoginModule.logout()
      • initialize

        public void initialize​(javax.security.auth.Subject subject,
                               javax.security.auth.callback.CallbackHandler callbackHandler,
                               java.util.Map<java.lang.String,​?> sharedState,
                               java.util.Map<java.lang.String,​?> options)
        Specified by:
        initialize in interface javax.security.auth.spi.LoginModule
        Parameters:
        subject - the subject
        callbackHandler - the callback handler
        sharedState - the shared state map
        options - the option map
        See Also:
        LoginModule.initialize(javax.security.auth.Subject, javax.security.auth.callback.CallbackHandler, java.util.Map, java.util.Map)