Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jdesktop.swingx.auth
Class SimpleLoginService

    java.lang.Object
      org.jdesktop.beans.AbstractBean
          org.jdesktop.swingx.auth.LoginService
              org.jdesktop.swingx.auth.SimpleLoginService

    public final class SimpleLoginService

extends LoginService

An implementation of LoginService that simply matches the username/password against a list of known users and their passwords. This is useful for demos or prototypes where a proper login server is not available. This Implementation is NOT secure. DO NOT USE this in a real application To make this implementation more secure, the passwords should be passed in and stored as the result of a one way hash algorithm. That way an attacker cannot simply read the password in memory to crack into the system.

Author:
  rbair

Constructor Summary
`SimpleLoginService(java.util.Map<java.lang.String,char[]> passwordMap)` Creates a new SimpleLoginService based on the given password map.

Method Summary
`boolean` | `authenticate(java.lang.String name, char[] password, java.lang.String server)` Attempts to authenticate the given username and password against the password map

Methods inherited from class org.jdesktop.swingx.auth.LoginService
`addLoginListener, cancelAuthentication, getServer, getSynchronous, getUserRoles, removeLoginListener, setServer, setSynchronous, startAuthentication`

Methods inherited from class org.jdesktop.beans.AbstractBean
`addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, clone, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, getPropertyChangeListeners, getPropertyChangeListeners, getVetoableChangeListeners, getVetoableChangeListeners, hasPropertyChangeListeners, hasVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener`

Methods inherited from class java.lang.Object
`equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### SimpleLoginService

    public SimpleLoginService(java.util.Map<java.lang.String,char[]> passwordMap)

  Creates a new SimpleLoginService based on the given password map.

Method Detail

### authenticate

    public boolean authenticate(java.lang.String name,
                                char[] password,
                                java.lang.String server)
                         throws java.lang.Exception

  Attempts to authenticate the given username and password against the password map

  Specified by:
    `authenticate` in class `LoginService`
  Parameters:
    `name` - username
    `password` - password
    `server` - server (optional)
  Returns:
    `true` on authentication success
  Throws:
    `java.lang.Exception`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2010. All Rights Reserved.