try {
log.debug("Initalize LoginModule: ");
RepositoryCallback repositoryCb = new RepositoryCallback();
callbackHandler.handle(new Callback[]{repositoryCb});
PrincipalProviderRegistry registry = repositoryCb.getPrincipalProviderRegistry();
// check if the class name of a PrincipalProvider implementation
// is present with the module configuration.
if (options.containsKey(LoginModuleConfig.PARAM_PRINCIPAL_PROVIDER_CLASS)) {
Object pcOption = options.get(LoginModuleConfig.PARAM_PRINCIPAL_PROVIDER_CLASS);
if (pcOption != null) {
principalProviderClassName = pcOption.toString();
}
}
if (principalProviderClassName != null) {
principalProvider = registry.getProvider(principalProviderClassName);
}
if (principalProvider == null) {
principalProvider = registry.getDefault();
if (principalProvider == null) {
return; // abort. not even a default principal provider
}
}
log.debug("- PrincipalProvider -> '" + principalProvider.getClass().getName() + "'");