public GenericPrincipal authenticate(String username,String password){
  GenericPrincipal principal=m_userPrincipal.get(username);
  if (principal != null) {
    if (!password.equals(principal.getPassword()))     throw new SpaceSecurityException("Wrong password for user name: " + username);
  }
 else   throw new SpaceSecurityException("Unknown user name: " + username);
  return principal;
}

public GenericPrincipal authenticate ( String username , String password ) { GenericPrincipal principal = m_userPrincipal . get ( username ) ; if ( principal != null ) { if ( ! password . equals ( principal . getPassword ( ) ) ) throw new SpaceSecurityException ( "Wrong password for user name: " + username ) ; } else throw new SpaceSecurityException ( "Unknown user name: " + username ) ; return principal ; }
return the principal associated with the specified username and credentials , if there is one ; otherwise throws securityexception .
