Class JAASLoginService


@JavaBean public class JAASLoginService extends LoginService
JAASLoginService implements a LoginService that uses JAAS for authentication. JAASLoginService uses the server name as name of the configuration for JAAS.
Author:
Bino George
  • Field Details

    • loginContext

      protected LoginContext loginContext
      LoginContext
  • Constructor Details

    • JAASLoginService

      public JAASLoginService(String server)
      Constructor for JAASLoginService
      Parameters:
      server - server name that is also used for the JAAS config name
    • JAASLoginService

      public JAASLoginService()
      Default JavaBeans constructor
  • Method Details

    • authenticate

      public boolean authenticate(String name, char[] password, String server) throws Exception
      This method is intended to be implemented by clients wishing to authenticate a user with a given password. Clients should implement the authentication in a manner that the authentication can be cancelled at any time.

      implement abstract method defined in class LoginService

      Specified by:
      authenticate in class LoginService
      Parameters:
      name - username
      password - password
      server - server (optional)
      Returns:
      true on authentication success
      Throws:
      Exception - TODO explain
    • getLoginContext

      public LoginContext getLoginContext()
      Returns the LoginContext used during the authentication process.
      Returns:
      LoginContext
    • getSubject

      public Subject getSubject()
      Returns the Subject representing the authenticated individual, or null if the user has not yet been successfully authenticated.
      Returns:
      Subject