use of org.jboss.as.domain.management.CallbackHandlerFactory in project wildfly by wildfly.
the class EJBClientDescriptorMetaDataProcessor method getCallbackHandler.
private CallbackHandler getCallbackHandler(final ServiceRegistry serviceRegistry, final String userName, final String securityRealmName) {
if (securityRealmName != null && !securityRealmName.trim().isEmpty()) {
final ServiceName securityRealmServiceName = SecurityRealm.ServiceUtil.createServiceName(securityRealmName);
final ServiceController<SecurityRealm> securityRealmController = (ServiceController<SecurityRealm>) serviceRegistry.getService(securityRealmServiceName);
if (securityRealmController != null) {
final SecurityRealm securityRealm = securityRealmController.getValue();
final CallbackHandlerFactory cbhFactory;
if (securityRealm != null && (cbhFactory = securityRealm.getSecretCallbackHandlerFactory()) != null && userName != null) {
return cbhFactory.getCallbackHandler(userName);
}
}
}
return null;
}
Aggregations