This topic has not yet been written. The content below is from the topic description.
Subclassing Steps The steps your custom login module must execute depend on which base login module class you choose. When writing a custom login module that integrates with your security infrastructure, you should start by sub-classing AbstractServerLoginModule or UsernamePasswordLoginModule to ensure that your login module provides the authenticated Principal information in the form expected by the JBossSX security manager. When sub-classing the AbstractServerLoginModule, you must override the following: void initialize(Subject, CallbackHandler, Map, Map): if you have custom options to parse. boolean login(): to perform the authentication activity. Be sure to set the loginOk instance variable to true if login succeeds, false if it fails. Principal getIdentity(): to return the Principal object for the user authenticated by the log() step. Group[] getRoleSets(): to return at least one Group named Roles that contains the roles assigned to the Principal authenticated during login(). A second common Group is named CallerPrincipal and provides the user's application identity rather than the security domain identity. When sub-classing the UsernamePasswordLoginModule, you must override the following: void initialize(Subject, CallbackHandler, Map, Map): if you have custom options to parse. Group[] getRoleSets(): to return at least one Group named Roles that contains the roles assigned to the Principal authenticated during login(). A second common Group is named CallerPrincipal and provides the user's application identity rather than the security domain identity. String getUsersPassword(): to return the expected password for the current user name available via the getUsername() method. The getUsersPassword() method is called from within login() after the callbackhandler returns the user name and candidate password.