Author: prabath
Date: Wed Jan 30 22:52:55 2008
New Revision: 13190
Log:
OpenIDIfoCards for self-issued InfoCard
Modified:
trunk/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/admin/STSConfigAdmin.java
Modified:
trunk/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/admin/STSConfigAdmin.java
==============================================================================
---
trunk/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/admin/STSConfigAdmin.java
(original)
+++
trunk/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/admin/STSConfigAdmin.java
Wed Jan 30 22:52:55 2008
@@ -45,53 +45,65 @@
private final static Messages messages = Messages
.getInstance(IdentityProviderConstants.RESOURCES);
- public static void configuraServices(boolean initial) throws
IdentityProviderException {
+ public static void configuraServices(boolean initial)
+ throws IdentityProviderException {
SecurityScenarioConfigAdmin admin = new SecurityScenarioConfigAdmin();
ConfigurationContext configContext = ConfigurationContextHolder
.getConfigurationContext();
AxisConfiguration axisConfig = configContext.getAxisConfiguration();
try {
- if(initial) {
+ if (initial) {
admin.assignUsersAndRoles(
IdentityProviderConstants.SERVICE_NAME_STS_UT, null,
"scenario1", new String[] { "admin" }, new String[]
{});
-
- admin.assignUsersAndRoles(
-
IdentityProviderConstants.OpenId.SERVICE_NAME_STS_OPENID, null,
- "scenario1", new String[] { "admin" }, new String[]
{});
-
+
+ admin
+ .assignUsersAndRoles(
+
IdentityProviderConstants.OpenId.SERVICE_NAME_STS_OPENID,
+ null, "scenario1", new String[] { "admin" },
+ new String[] {});
+
PersistenceManager db = new PersistenceManager();
KeyStoreDO[] keyStoreDOs = db.getKeyStores();
-
+
// Assuming there's only one keystore
// Keystore path comparison to find the default keystore
doesn't
// work
// in windows :-(
String ksName = keyStoreDOs[0].getKeyStoreName();
-
+
admin.assignUsersAndRolesAndKeyStores(
IdentityProviderConstants.SERVICE_NAME_STS_IC, null,
"scenario2", new String[] { ksName }, ksName,
new String[] { "admin" }, new String[] {});
-
+
+ admin
+ .assignUsersAndRolesAndKeyStores(
+
IdentityProviderConstants.OpenId.SERVICE_NAME_STS_IC_OPENID,
+ null, "scenario2", new String[] { ksName },
+ ksName, new String[] { "admin" },
+ new String[] {});
+
admin.assignUsersAndRolesAndKeyStores(
- IdentityProviderConstants.SERVICE_NAME_STS_UT_SYMM,
null,
- "scenario3", new String[] { ksName }, ksName,
+ IdentityProviderConstants.SERVICE_NAME_STS_UT_SYMM,
+ null, "scenario3", new String[] { ksName }, ksName,
new String[] { "admin" }, new String[] {});
-
+
admin.assignUsersAndRolesAndKeyStores(
- IdentityProviderConstants.SERVICE_NAME_STS_IC_SYMM,
null,
- "scenario4", new String[] { ksName }, ksName,
+ IdentityProviderConstants.SERVICE_NAME_STS_IC_SYMM,
+ null, "scenario4", new String[] { ksName }, ksName,
new String[] { "admin" }, new String[] {});
}
-
+
// Set the callback handler
- overrideCallbackHandler(axisConfig,
IdentityProviderConstants.SERVICE_NAME_STS_UT);
- overrideCallbackHandler(axisConfig,
IdentityProviderConstants.SERVICE_NAME_STS_UT_SYMM);
- overrideCallbackHandler(axisConfig,
IdentityProviderConstants.OpenId.SERVICE_NAME_STS_OPENID);
-
-
+ overrideCallbackHandler(axisConfig,
+ IdentityProviderConstants.SERVICE_NAME_STS_UT);
+ overrideCallbackHandler(axisConfig,
+ IdentityProviderConstants.SERVICE_NAME_STS_UT_SYMM);
+ overrideCallbackHandler(axisConfig,
+ IdentityProviderConstants.OpenId.SERVICE_NAME_STS_OPENID);
+
} catch (AxisFault e) {
log.error(messages
.getMessage("errorInChangingSecurityConfiguration"), e);
@@ -101,15 +113,14 @@
}
/**
- * Override WSAS callback handler to be able to auth users with
- * usermanager.
+ * Override WSAS callback handler to be able to auth users with
usermanager.
+ *
* @param axisConfig
* @throws AxisFault
*/
- private static void overrideCallbackHandler(
- AxisConfiguration axisConfig, String service) throws AxisFault {
- AxisService sts = axisConfig
- .getService(service);
+ private static void overrideCallbackHandler(AxisConfiguration axisConfig,
+ String service) throws AxisFault {
+ AxisService sts = axisConfig.getService(service);
Parameter cbHandlerParam = sts
.getParameter(WSHandlerConstants.PW_CALLBACK_REF);
if (cbHandlerParam != null) {
@@ -120,9 +131,10 @@
}
}
- IPPasswordCallback cb = new
IPPasswordCallback((CallbackHandler)WSS4JUtil
- .getPasswordCallBackRefParameter(service, null).getValue());
-
+ IPPasswordCallback cb = new IPPasswordCallback(
+ (CallbackHandler) WSS4JUtil.getPasswordCallBackRefParameter(
+ service, null).getValue());
+
Parameter param = new Parameter();
param.setName(WSHandlerConstants.PW_CALLBACK_REF);
param.setValue(cb);
_______________________________________________
Identity-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/identity-dev