use of org.apache.jackrabbit.oak.spi.security.authentication.callback.UserManagerCallback in project jackrabbit-oak by apache.
the class AbstractLoginModule method getUserManager.
/**
* Retrieves the {@link UserManager} that should be used to handle
* this authentication. If no user manager has been configure this
* method returns {@code null}.
*
* @return A instance of {@code UserManager} or {@code null}.
*/
@CheckForNull
protected UserManager getUserManager() {
UserManager userManager = null;
SecurityProvider sp = getSecurityProvider();
Root r = getRoot();
if (r != null && sp != null) {
UserConfiguration uc = securityProvider.getConfiguration(UserConfiguration.class);
userManager = uc.getUserManager(r, NamePathMapper.DEFAULT);
}
if (userManager == null && callbackHandler != null) {
try {
UserManagerCallback userCallBack = new UserManagerCallback();
callbackHandler.handle(new Callback[] { userCallBack });
userManager = userCallBack.getUserManager();
} catch (IOException | UnsupportedCallbackException e) {
log.debug(e.getMessage());
}
}
return userManager;
}
Aggregations