jhomenet.server.auth
Class CustomLoginService

java.lang.Object
  extended by AbstractBean
      extended by jhomenet.server.auth.swingx.JHSLoginService
          extended by jhomenet.server.auth.CustomLoginService

public class CustomLoginService
extends JHSLoginService

A custom login service that extends the LoginService base class. This class is used to authenticate a user against the list of available users defined in the database.

This class should always be used to perform any type of user authentication because this class provides a number of utilities and functions that make the login process easier to manage. The AuthFacade class can also be used to authenticate users but it doesn't provide any built-in utility functions. It's recommended that this class be used and that the AuthFacade not be used.

Id: $Id: $

Author:
Dave Irwin (jhomenet at gmail dot com)
See Also:
jhomenet.server.auth.AuthFacade

Constructor Summary
CustomLoginService(AuthFacade authFacade)
          Constructor.
 
Method Summary
 boolean authenticate(java.lang.String username, char[] password, java.lang.String server)
          This method is intended to be implemented by clients wishing to authenticate a user with a given password.
 java.lang.String getUsername()
           
 
Methods inherited from class jhomenet.server.auth.swingx.JHSLoginService
addLoginListener, cancelAuthentication, getServer, getSynchronous, getUserRoles, removeLoginListener, setServer, setSynchronous, startAuthentication
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CustomLoginService

public CustomLoginService(AuthFacade authFacade)
Constructor.

Parameters:
authFacade -
Method Detail

authenticate

public boolean authenticate(java.lang.String username,
                            char[] password,
                            java.lang.String server)
                     throws java.lang.Exception
Description copied from class: JHSLoginService
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.

Specified by:
authenticate in class JHSLoginService
Parameters:
username - username
password - password
server - server (optional)
Returns:
true on authentication success
Throws:
java.lang.Exception
See Also:
org.jdesktop.swingx.auth.LoginService#authenticate(java.lang.String, char[], java.lang.String)

getUsername

public final java.lang.String getUsername()
Returns:
the username


Copyright © 2004-2007 David Irwin. All Rights Reserved.