use of com.sun.identity.wsfederation.jaxb.entityconfig.BaseConfigType in project OpenAM by OpenRock.
the class WSFedPropertiesModelImpl method getspsso.
/**
* Retrieves the SPSSOConfigElement.
*
* @param fed is the FederationConfigElement.
* @return the corresponding SPSSOConfigType Object.
*/
private SPSSOConfigElement getspsso(FederationConfigElement fed) {
List listFed = fed.getIDPSSOConfigOrSPSSOConfig();
SPSSOConfigElement spsso = null;
Iterator i = listFed.iterator();
//SPSSOConfigElement ?????
while (i.hasNext()) {
BaseConfigType bc = (BaseConfigType) i.next();
if (bc instanceof SPSSOConfigElement) {
spsso = (SPSSOConfigElement) bc;
break;
}
}
return spsso;
}
use of com.sun.identity.wsfederation.jaxb.entityconfig.BaseConfigType in project OpenAM by OpenRock.
the class WSFedPropertiesModelImpl method getidpsso.
/**
* Retrieves the IDPSSOConfigElement .
*
* @param fed is the FederationConfigElement.
* @return the corresponding IDPSSOConfigType Object.
*/
private IDPSSOConfigElement getidpsso(FederationConfigElement fed) {
List listFed = fed.getIDPSSOConfigOrSPSSOConfig();
IDPSSOConfigElement idpsso = null;
Iterator i = listFed.iterator();
//IDPSSOConfigElement ?????
while (i.hasNext()) {
BaseConfigType bc = (BaseConfigType) i.next();
if (bc instanceof IDPSSOConfigElement) {
idpsso = (IDPSSOConfigElement) bc;
break;
}
}
return idpsso;
}
use of com.sun.identity.wsfederation.jaxb.entityconfig.BaseConfigType in project OpenAM by OpenRock.
the class WSFedPropertiesModelImpl method setSPExtAttributeValues.
/**
* Saves the extended metadata attribute values for the SP.
*
* @param realm to which the entity belongs.
* @param fedId is the entity id.
* @param spExtvalues has the extended attribute value pairs of SP.
* @param location has the information whether remote or hosted.
* @throws AMConsoleException if saving of attribute value fails.
*/
public void setSPExtAttributeValues(String realm, String fedId, Map spExtvalues, String location) throws AMConsoleException {
try {
String role = EntityModel.SERVICE_PROVIDER;
//fed is the extended entity configuration object under the realm
WSFederationMetaManager metaManager = getWSFederationMetaManager();
FederationConfigElement fed = metaManager.getEntityConfig(realm, fedId);
if (fed == null) {
SPEX_DATA_MAP.put(TF_DISPNAME, Collections.EMPTY_SET);
createExtendedObject(realm, fedId, location, SERVICE_PROVIDER, SPEX_DATA_MAP);
fed = metaManager.getEntityConfig(realm, fedId);
}
SPSSOConfigElement spsso = getspsso(fed);
if (spsso != null) {
BaseConfigType baseConfig = (BaseConfigType) spsso;
updateBaseConfig(baseConfig, spExtvalues, role);
}
//saves the attributes by passing the new fed object
metaManager.setEntityConfig(realm, fed);
} catch (JAXBException e) {
debug.warning("WSFedPropertiesModelImpl.setSPExtAttributeValues", e);
throw new AMConsoleException(e.getMessage());
} catch (WSFederationMetaException e) {
debug.warning("WSFedPropertiesModelImpl.setSPExtAttributeValues", e);
throw new AMConsoleException(e.getMessage());
}
}
use of com.sun.identity.wsfederation.jaxb.entityconfig.BaseConfigType in project OpenAM by OpenRock.
the class WSFederationMetaManager method getEntityByMetaAlias.
/**
* Returns entity ID associated with the metaAlias.
*
* @param metaAlias The metaAlias.
* @return entity ID associated with the metaAlias or null if not found.
* @throws WSFederationMetaException if unable to retrieve the entity ids.
*/
public String getEntityByMetaAlias(String metaAlias) throws WSFederationMetaException {
String realm = WSFederationMetaUtils.getRealmByMetaAlias(metaAlias);
try {
Set entityIds = configInst.getAllConfigurationNames(realm);
if (entityIds == null || entityIds.isEmpty()) {
return null;
}
for (Iterator iter = entityIds.iterator(); iter.hasNext(); ) {
String federationId = (String) iter.next();
FederationConfigElement config = getEntityConfig(realm, federationId);
if (config == null) {
continue;
}
List list = config.getIDPSSOConfigOrSPSSOConfig();
for (Iterator iter2 = list.iterator(); iter2.hasNext(); ) {
BaseConfigType bConfig = (BaseConfigType) iter2.next();
String cMetaAlias = bConfig.getMetaAlias();
if (cMetaAlias != null && cMetaAlias.equals(metaAlias)) {
return federationId;
}
}
}
} catch (ConfigurationException e) {
debug.error("WSFederationMetaManager.getEntityByMetaAlias:", e);
throw new WSFederationMetaException(e);
}
return null;
}
use of com.sun.identity.wsfederation.jaxb.entityconfig.BaseConfigType in project OpenAM by OpenRock.
the class ValidWReplyExtractor method extractValidDomains.
@Override
public Collection<String> extractValidDomains(final WSFederationEntityInfo entityInfo) {
try {
BaseConfigType config;
final Map<String, List<String>> attrs;
if (SAML2Constants.SP_ROLE.equalsIgnoreCase(entityInfo.role)) {
config = WSFederationUtils.getMetaManager().getSPSSOConfig(entityInfo.realm, entityInfo.entityID);
} else {
config = WSFederationUtils.getMetaManager().getIDPSSOConfig(entityInfo.realm, entityInfo.entityID);
}
if (config == null) {
DEBUG.warning("ValidWReplyExtractor.getValidDomains: Entity config is null for entityInfo: " + entityInfo);
return null;
}
attrs = WSFederationMetaUtils.getAttributes(config);
if (attrs == null) {
DEBUG.warning("ValidWReplyExtractor.getValidDomains: Cannot find extended attributes");
return null;
}
final List<String> values = attrs.get(WSFederationConstants.WREPLY_URL_LIST);
if (values != null && !values.isEmpty()) {
return values;
}
} catch (final WSFederationMetaException sme) {
DEBUG.warning("Unable to retrieve extended configuration", sme);
}
return null;
}
Aggregations