@Override
public SecuritySession authenticate( AuthenticationDataSource source )
throws AuthenticationException, UserNotFoundException, AccountLockedException
{
AuthenticationResult result = null;
SecuritySession session = null;
if ( users.get( source.getUsername() ) != null )
{
result = new AuthenticationResult( true, source.getUsername(), null );
User user = new JdoUser();
user.setUsername( source.getUsername() );
user.setPassword( users.get( source.getUsername() ) );
session = new DefaultSecuritySession( result, user );
}
else
{
result = new AuthenticationResult( false, source.getUsername(), null );
session = new DefaultSecuritySession( result );
}
return session;
}