in plugins/websphere/src/main/java/org/apache/cxf/fediz/was/tai/FedizInterceptor.java [150:203]
public int initialize(Properties props) throws WebTrustAssociationFailedException {
if (props != null) {
try {
@SuppressWarnings("deprecation")
String roleGroupMapper = props.containsKey(Constants.PROPERTY_KEY_ROLE_MAPPER) ? props
.getProperty(Constants.PROPERTY_KEY_ROLE_MAPPER) : props
.getProperty(Constants.ROLE_GROUP_MAPPER);
if (roleGroupMapper != null && !roleGroupMapper.isEmpty()) {
try {
mapper = (RoleToGroupMapper)Class.forName(roleGroupMapper).newInstance();
LOG.debug("Using the {} mapper class", roleGroupMapper);
mapper.initialize(props);
} catch (Exception e) {
throw new TAIConfigurationException(
"Invalid TAI configuration for idpRoleToGroupMapper: "
+ e.getClass().getName() + " "
+ e.getMessage());
}
} else {
mapper = new DefaultRoleToGroupMapper();
LOG.debug("Using the DefaultRoleToGroupMapper mapper class");
}
@SuppressWarnings("deprecation")
String configFileLocation = props.containsKey(Constants.PROPERTY_KEY_CONFIG_LOCATION) ? props
.getProperty(Constants.PROPERTY_KEY_CONFIG_LOCATION) : props
.getProperty(Constants.CONFIGURATION_FILE_PARAMETER);
if (configFileLocation != null) {
LOG.debug("Configuration file location set to {}", configFileLocation);
File f = new File(configFileLocation);
configurator = new FedizConfigurator();
configurator.loadConfig(f);
LOG.debug("Federation config loaded from path: {}", configFileLocation);
} else {
throw new WebTrustAssociationFailedException("Missing required initialization parameter "
+ Constants.PROPERTY_KEY_CONFIG_LOCATION);
}
directGroupMapping = Boolean.valueOf(props
.getProperty(Constants.PROPERTY_KEY_DIRECT_GROUP_MAPPING));
cookieName = props.getProperty(Constants.PROPERTY_SESSION_COOKIE_NAME);
if (cookieName == null) {
cookieName = Constants.SESSION_COOKIE_DEFAULT_NAME;
}
} catch (Throwable t) {
LOG.warn("Failed initializing TAI", t);
return 1;
}
}
return 0;
}