use of com.sun.identity.saml2.meta.SAML2MetaException in project OpenAM by OpenRock.
the class SAMLv2ModelImpl method setExtauthnAuthValues.
/**
* Saves the extended attribute values for Authn Authority.
*
* @param realm to which the entity belongs.
* @param entityName is the entity id.
* @param authnAuthExtValues Map which contains the extended values.
* @param location has the information whether remote or hosted.
* @throws AMConsoleException if saving of attribute value fails.
*/
public void setExtauthnAuthValues(String realm, String entityName, Map authnAuthExtValues, String location) throws AMConsoleException {
String[] params = { realm, entityName, "SAMLv2", "AuthnAuthority-Ext" };
logEvent("ATTEMPT_MODIFY_AUTHN_AUTH_ATTR_VALUES", params);
String role = EntityModel.SAML_AUTHNAUTHORITY;
try {
SAML2MetaManager samlManager = getSAML2MetaManager();
//entityConfig is the extended entity configuration object
EntityConfigElement entityConfig = samlManager.getEntityConfig(realm, entityName);
//for remote cases
if (entityConfig == null) {
createExtendedObject(realm, entityName, location, role);
entityConfig = samlManager.getEntityConfig(realm, entityName);
}
AuthnAuthorityConfigElement authnAuthorityConfig = samlManager.getAuthnAuthorityConfig(realm, entityName);
if (authnAuthorityConfig != null) {
updateBaseConfig(authnAuthorityConfig, authnAuthExtValues, role);
}
//saves the attributes by passing the new entityConfig object
samlManager.setEntityConfig(realm, entityConfig);
logEvent("SUCCEED_MODIFY_AUTHN_AUTH_ATTR_VALUES", params);
} catch (SAML2MetaException e) {
debug.error("SAMLv2ModelImpl.setExtauthnAuthValues:", e);
String strError = getErrorString(e);
String[] paramsEx = { realm, entityName, "SAMLv2", "AuthnAuthority-Ext", strError };
logEvent("FEDERATION_EXCEPTION_MODIFY_AUTHN_AUTH_ATTR_VALUES", paramsEx);
} catch (JAXBException e) {
debug.error("SAMLv2ModelImpl.setExtauthnAuthValues:", e);
String strError = getErrorString(e);
String[] paramsEx = { realm, entityName, "SAMLv2", "AuthnAuthority-Extended", strError };
logEvent("FEDERATION_EXCEPTION_MODIFY_AUTHN_AUTH_ATTR_VALUES", paramsEx);
} catch (AMConsoleException e) {
debug.error("SAMLv2ModelImpl.setExtauthnAuthValues:", e);
String strError = getErrorString(e);
String[] paramsEx = { realm, entityName, "SAMLv2", "AuthnAuthority-Ext", strError };
logEvent("FEDERATION_EXCEPTION_MODIFY_AUTHN_AUTH_ATTR_VALUES", paramsEx);
}
}
use of com.sun.identity.saml2.meta.SAML2MetaException in project OpenAM by OpenRock.
the class SAMLv2ModelImpl method getAssertionConsumerServices.
/**
* Returns a List with Assertion Consumer Service attributes and values.
*
* @param realm to which the entity belongs.
* @param entityName is the entity id.
* @return List with Assertion Consumer values of Service Provider.
* @throws AMConsoleException if unable to retrieve the Service Provider
* Assertion Consumer values based on the realm and entityName passed.
*/
public List getAssertionConsumerServices(String realm, String entityName) throws AMConsoleException {
List asconsServiceList = null;
SPSSODescriptorElement spssoDescriptor = null;
try {
SAML2MetaManager samlManager = getSAML2MetaManager();
spssoDescriptor = samlManager.getSPSSODescriptor(realm, entityName);
if (spssoDescriptor != null) {
asconsServiceList = spssoDescriptor.getAssertionConsumerService();
}
} catch (SAML2MetaException e) {
if (debug.warningEnabled()) {
debug.warning("SAMLv2ModelImpl.getAssertionConsumerService", e);
}
throw new AMConsoleException(getErrorString(e));
}
return asconsServiceList;
}
use of com.sun.identity.saml2.meta.SAML2MetaException in project OpenAM by OpenRock.
the class SAMLv2ModelImpl method setExtAttributeAuthorityValues.
/**
* Saves the extended attribute values for Attribute Authority.
*
* @param realm to which the entity belongs.
* @param entityName is the entity id.
* @param attrAuthExtValues Map which contains the extended values.
* @param location has the information whether remote or hosted.
* @throws AMConsoleException if saving of attribute value fails.
*/
public void setExtAttributeAuthorityValues(String realm, String entityName, Map attrAuthExtValues, String location) throws AMConsoleException {
String[] params = { realm, entityName, "SAMLv2", "AttribAuthority-Ext" };
logEvent("ATTEMPT_MODIFY_ATTR_AUTH_ATTR_VALUES", params);
String role = EntityModel.SAML_ATTRAUTHORITY;
try {
SAML2MetaManager samlManager = getSAML2MetaManager();
EntityConfigElement entityConfig = samlManager.getEntityConfig(realm, entityName);
//for remote cases
if (entityConfig == null) {
createExtendedObject(realm, entityName, location, role);
entityConfig = samlManager.getEntityConfig(realm, entityName);
}
AttributeAuthorityConfigElement attributeAuthorityConfig = samlManager.getAttributeAuthorityConfig(realm, entityName);
if (attributeAuthorityConfig != null) {
updateBaseConfig(attributeAuthorityConfig, attrAuthExtValues, role);
}
//saves the attributes by passing the new entityConfig object
samlManager.setEntityConfig(realm, entityConfig);
logEvent("SUCCEED_MODIFY_ATTR_AUTH_ATTR_VALUES", params);
} catch (SAML2MetaException e) {
debug.error("SAMLv2ModelImpl.setExtAttributeAuthorityValues:", e);
String strError = getErrorString(e);
String[] paramsEx = { realm, entityName, "SAMLv2", "AttribAuthority-Ext", strError };
logEvent("FEDERATION_EXCEPTION_MODIFY_ATTR_AUTH_ATTR_VALUES", paramsEx);
} catch (JAXBException e) {
debug.error("SAMLv2ModelImpl.setExtAttributeAuthorityValues:", e);
String strError = getErrorString(e);
String[] paramsEx = { realm, entityName, "SAMLv2", "AttribAuthority-Extended", strError };
logEvent("FEDERATION_EXCEPTION_MODIFY_ATTR_AUTH_ATTR_VALUES", paramsEx);
} catch (AMConsoleException e) {
debug.error("SAMLv2ModelImpl.setExtAttributeAuthorityValues:", e);
String strError = getErrorString(e);
String[] paramsEx = { realm, entityName, "SAMLv2", "AttribAuthority-Ext", strError };
logEvent("FEDERATION_EXCEPTION_MODIFY_ATTR_AUTH_ATTR_VALUES", paramsEx);
}
}
use of com.sun.identity.saml2.meta.SAML2MetaException in project OpenAM by OpenRock.
the class SAMLv2ModelImpl method getExtendedAuthnAuthorityAttributes.
/**
* Returns a map with extended AuthnAuthority attributes and values.
*
* @param realm to which the entity belongs.
* @param entityName is the entity id.
* @return Map with extended AuthnAuthority values.
* @throws AMConsoleException if unable to retrieve ext AuthnAuthority
* attributes based on the realm and entityName passed.
*/
public Map getExtendedAuthnAuthorityAttributes(String realm, String entityName) throws AMConsoleException {
String[] params = { realm, entityName, "SAMLv2", "AuthnAuthority-Ext" };
logEvent("ATTEMPT_GET_AUTHN_AUTH_ATTR_VALUES", params);
Map map = null;
AuthnAuthorityConfigElement authnAuthorityConfig = null;
try {
SAML2MetaManager samlManager = getSAML2MetaManager();
authnAuthorityConfig = samlManager.getAuthnAuthorityConfig(realm, entityName);
if (authnAuthorityConfig != null) {
BaseConfigType baseConfig = (BaseConfigType) authnAuthorityConfig;
map = SAML2MetaUtils.getAttributes(baseConfig);
}
logEvent("SUCCEED_GET_AUTHN_AUTH_ATTR_VALUES", params);
} catch (SAML2MetaException e) {
debug.warning("SAMLv2ModelImpl.getExtendedAuthnAuthorityAttributes:", e);
String strError = getErrorString(e);
String[] paramsEx = { realm, entityName, "SAMLv2", "AuthnAuthority-Ext", strError };
logEvent("FEDERATION_EXCEPTION_GET_AUTHN_AUTH_ATTR_VALUES", paramsEx);
throw new AMConsoleException(strError);
}
return (map != null) ? map : Collections.EMPTY_MAP;
}
use of com.sun.identity.saml2.meta.SAML2MetaException in project OpenAM by OpenRock.
the class SAMLv2ModelImpl method setStdAffilationValues.
/**
* Saves the standard attribute values for Affilaition.
*
* @param realm to which the entity belongs.
* @param entityName is the entity id.
* @param affiliationValues Map which contains standard affiliation values.
* @param members Set which contains all members.
* @throws AMConsoleException if saving of attribute value fails.
*/
public void setStdAffilationValues(String realm, String entityName, Map affiliationValues, Set members) throws AMConsoleException {
String[] params = { realm, entityName, "SAMLv2", "Affiliation-Std" };
logEvent("ATTEMPT_MODIFY_AFFILIATION_ATTR_VALUES", params);
AffiliationDescriptorType affiliationDescriptor = null;
try {
SAML2MetaManager samlManager = getSAML2MetaManager();
EntityDescriptorElement entityDescriptor = samlManager.getEntityDescriptor(realm, entityName);
affiliationDescriptor = samlManager.getAffiliationDescriptor(realm, entityName);
if (affiliationDescriptor != null) {
//save memberlist
List memberList = affiliationDescriptor.getAffiliateMember();
if (!memberList.isEmpty()) {
List listtoSave = convertSetToList(members);
affiliationDescriptor.getAffiliateMember().clear();
Iterator itt = listtoSave.listIterator();
while (itt.hasNext()) {
String name = (String) itt.next();
affiliationDescriptor.getAffiliateMember().add(name);
}
}
String owner = getResult(affiliationValues, AFFILIATE_OWNER);
if (owner != null && owner.length() > 0) {
affiliationDescriptor.setAffiliationOwnerID(owner);
}
samlManager.setEntityDescriptor(realm, entityDescriptor);
}
logEvent("SUCCEED_MODIFY_AFFILIATION_ATTR_VALUES", params);
} catch (SAML2MetaException e) {
debug.warning("SAMLv2ModelImpl.setStdAffilationValues:", e);
String strError = getErrorString(e);
String[] paramsEx = { realm, entityName, "SAMLv2", "Affilaition-Std", strError };
logEvent("FEDERATION_EXCEPTION_MODIFY_AFFILIATION_ATTR_VALUES", paramsEx);
throw new AMConsoleException(strError);
}
}
Aggregations