Class JAASLoginService

    • Field Detail

      • DEFAULT_ROLE_CLASS_NAME

        public static final java.lang.String DEFAULT_ROLE_CLASS_NAME
        See Also:
        Constant Field Values
      • DEFAULT_ROLE_CLASS_NAMES

        public static final java.lang.String[] DEFAULT_ROLE_CLASS_NAMES
      • INSTANCE

        public static final java.lang.ThreadLocal<JAASLoginService> INSTANCE
      • _roleClassNames

        protected java.lang.String[] _roleClassNames
      • _callbackHandlerClass

        protected java.lang.String _callbackHandlerClass
      • _realmName

        protected java.lang.String _realmName
      • _loginModuleName

        protected java.lang.String _loginModuleName
      • _configuration

        protected javax.security.auth.login.Configuration _configuration
    • Constructor Detail

      • JAASLoginService

        public JAASLoginService()
      • JAASLoginService

        public JAASLoginService​(java.lang.String name)
        Parameters:
        name - the name of the realm
    • Method Detail

      • getName

        public java.lang.String getName()
        Get the name of the realm.
        Specified by:
        getName in interface LoginService
        Returns:
        name or null if not set.
      • setName

        public void setName​(java.lang.String name)
        Set the name of the realm
        Parameters:
        name - a String value
      • getConfiguration

        public javax.security.auth.login.Configuration getConfiguration()
        Returns:
        the configuration
      • setConfiguration

        public void setConfiguration​(javax.security.auth.login.Configuration configuration)
        Parameters:
        configuration - the configuration to set
      • setIdentityService

        public void setIdentityService​(IdentityService identityService)
        Set the identityService.
        Specified by:
        setIdentityService in interface LoginService
        Parameters:
        identityService - the identityService to set
      • setLoginModuleName

        public void setLoginModuleName​(java.lang.String name)
        Set the name to use to index into the config file of LoginModules.
        Parameters:
        name - a String value
      • setCallbackHandlerClass

        public void setCallbackHandlerClass​(java.lang.String classname)
      • setRoleClassNames

        public void setRoleClassNames​(java.lang.String[] classnames)
      • getRoleClassNames

        public java.lang.String[] getRoleClassNames()
      • doStart

        protected void doStart()
                        throws java.lang.Exception
        Description copied from class: ContainerLifeCycle
        Starts the managed lifecycle beans in the order they were added.
        Overrides:
        doStart in class ContainerLifeCycle
        Throws:
        java.lang.Exception
      • login

        public UserIdentity login​(java.lang.String username,
                                  java.lang.Object credentials,
                                  javax.servlet.ServletRequest request)
        Description copied from interface: LoginService
        Login a user.
        Specified by:
        login in interface LoginService
        Parameters:
        username - The user name
        credentials - The users credentials
        request - TODO
        Returns:
        A UserIdentity if the credentials matched, otherwise null
      • getGroups

        protected java.lang.String[] getGroups​(javax.security.auth.Subject subject)
        Get all of the groups for the user.
        Parameters:
        subject - the Subject representing the user
        Returns:
        all the names of groups that the user is in, or 0 length array if none