Class XMLLoginModule

  • All Implemented Interfaces:
    LoginModule

    public class XMLLoginModule
    extends UsernamePasswordLoginModule
    A login module that obtains its security information directly from its login module options. The name of the login module comes from the use of the login-config.xml descriptor which allows the user/roles content to be embedded directly in the login module configuration. The following login-config.xml fragment illustrates an example: ... guest
    Version:
    $Revision$
    Author:
    Scott.Stark@jboss.org
    • Constructor Detail

      • XMLLoginModule

        public XMLLoginModule()
    • Method Detail

      • initialize

        public void initialize​(Subject subject,
                               CallbackHandler callbackHandler,
                               Map<String,​?> sharedState,
                               Map<String,​?> options)
        Initialize this LoginModule.
        Specified by:
        initialize in interface LoginModule
        Overrides:
        initialize in class UsernamePasswordLoginModule
        Parameters:
        options - - the login module option map. Supported options include: userInfo: The name of the properties resource containing user/passwords. The default is "users.properties"
        subject - the Subject to update after a successful login.
        callbackHandler - the CallbackHandler that will be used to obtain the the user identity and credentials.
        sharedState - a Map shared between all configured login module instances
      • login

        public boolean login()
                      throws LoginException
        Method to authenticate a Subject (phase 1). This validates that the users and roles properties files were loaded and then calls super.login to perform the validation of the password.
        Specified by:
        login in interface LoginModule
        Overrides:
        login in class UsernamePasswordLoginModule
        Throws:
        LoginException - thrown if the users or roles properties files were not found or the super.login method fails.
      • getUsersPassword

        protected String getUsersPassword()
        Description copied from class: UsernamePasswordLoginModule
        Get the expected password for the current username available via the getUsername() method. This is called from within the login() method after the CallbackHandler has returned the username and candidate password.
        Specified by:
        getUsersPassword in class UsernamePasswordLoginModule
        Returns:
        the valid password String