public static void configureService(String serviceName) throws IdentityProviderException {
try {
AxisConfiguration axisConfig = IdentitySTSMgtServiceComponent.getConfigurationContext()
.getAxisConfiguration();
SecurityConfigAdmin admin = new SecurityConfigAdmin(axisConfig,
IdentitySTSMgtServiceComponent.getRegistryService().getConfigSystemRegistry(),
new IPPasswordCallbackHandler());
ServerConfiguration serverConfig = ServerConfiguration.getInstance();
String ksName = serverConfig.getFirstProperty("Security.KeyStore.Location");
ksName = ksName.substring(ksName.lastIndexOf("/") + 1);
if (log.isDebugEnabled()) {
log.debug("Applying identity security policy for service " + serviceName);
}
if (IdentityProviderUtil.isIntial()) {
if (IdentityConstants.SERVICE_NAME_STS_UT.equals(serviceName)) {
admin.applySecurity(IdentityConstants.SERVICE_NAME_STS_UT, "scenario19", null, null,
null, null);
} else if (IdentityConstants.OpenId.SERVICE_NAME_STS_OPENID.equals(serviceName)) {
admin.applySecurity(IdentityConstants.OpenId.SERVICE_NAME_STS_OPENID,
"scenario19", null, null, null, null);
} else if (IdentityConstants.SERVICE_NAME_STS_IC.equals(serviceName)) {
admin.applySecurity(IdentityConstants.SERVICE_NAME_STS_IC, "scenario18",
null, new String[] { ksName }, ksName, null);
} else if (IdentityConstants.OpenId.SERVICE_NAME_STS_IC_OPENID.equals(serviceName)) {
admin.applySecurity(IdentityConstants.OpenId.SERVICE_NAME_STS_IC_OPENID,
"scenario18", null, new String[] { ksName }, ksName, null);
} else if (IdentityConstants.SERVICE_NAME_STS_UT_SYMM.equals(serviceName)) {
admin.applySecurity(IdentityConstants.SERVICE_NAME_STS_UT_SYMM, "scenario18",
null, new String[] { ksName }, ksName, null);
} else if (IdentityConstants.SERVICE_NAME_STS_IC_SYMM.equals(serviceName)) {
admin.applySecurity(IdentityConstants.SERVICE_NAME_STS_IC_SYMM, "scenario18",
null, new String[] { ksName }, ksName, null);
}
}
if (IdentityConstants.SERVICE_NAME_STS_UT.equals(serviceName)) {