users.put("guest","guest");
users.put("admin","admin");
final PropertiesPrincipalDatabase ppd = new PropertiesPrincipalDatabase(users);
final AuthenticationManager pdam = new PrincipalDatabaseAuthenticationManager(ppd);
pdam.initialise();
return new IAuthenticationManagerRegistry()
{
@Override
public void close()
{
pdam.close();
}
@Override
public SubjectCreator getSubjectCreator(SocketAddress address)
{
return new SubjectCreator(pdam, groupPrincipalAccessor);
}
@Override
public Map<String, AuthenticationManager> getAvailableAuthenticationManagers()
{
return Collections.singletonMap(pdam.getClass().getName(), pdam);
}
@Override
public void addRegistryChangeListener(RegistryChangeListener listener)
{