String clazz = configuration.getString("pd-auth-manager.principal-database.class");
String passwordArgumentName = configuration.getString("pd-auth-manager.principal-database.attributes.attribute.name");
String passwordFile = configuration.getString("pd-auth-manager.principal-database.attributes.attribute.value");
PrincipalDatabase principalDatabase = createKnownImplementation(clazz);
if (principalDatabase == null)
{
LOGGER.warn("Config for pd-auth-manager found but principal-database class specified in config " + clazz +
" not recognised.");
return null;
}
if (!"passwordFile".equals(passwordArgumentName) || passwordFile == null)
{
LOGGER.warn("Config for pd-auth-manager found but config incomplete - expected attributes not found.");
return null;
}
try
{
principalDatabase.setPasswordFile(passwordFile);
}
catch (IOException e)
{
throw new RuntimeException(e.getMessage(), e);
}