use of com.sun.identity.saml2.jaxb.metadata.ManageNameIDServiceElement in project OpenAM by OpenRock.
the class DoManageNameID method getSPManageNameIDConfig.
/**
* Returns first ManageNameID configuration in an entity under
* the realm.
* @param realm The realm under which the entity resides.
* @param entityId ID of the entity to be retrieved.
* @param binding bind type need to has to be matched.
* @return <code>ManageNameIDServiceElement</code> for the entity or null
* @throws SAML2MetaException if unable to retrieve the first identity
* provider's SSO configuration.
* @throws SessionException invalid or expired single-sign-on session.
*/
public static ManageNameIDServiceElement getSPManageNameIDConfig(String realm, String entityId, String binding) throws SAML2MetaException, SessionException {
ManageNameIDServiceElement mni = null;
SPSSODescriptorElement spSSODesc = metaManager.getSPSSODescriptor(realm, entityId);
if (spSSODesc == null) {
return null;
}
List list = spSSODesc.getManageNameIDService();
if ((list != null) && !list.isEmpty()) {
if (binding == null) {
return (ManageNameIDServiceElement) list.get(0);
}
Iterator it = list.iterator();
while (it.hasNext()) {
mni = (ManageNameIDServiceElement) it.next();
if (binding.equalsIgnoreCase(mni.getBinding())) {
break;
}
}
}
return mni;
}
use of com.sun.identity.saml2.jaxb.metadata.ManageNameIDServiceElement in project OpenAM by OpenRock.
the class SAMLv2ModelImpl method saveSPsoapMni.
/**
* Saves the Soap ManageNameID Service for SP.
*
* @param mnisoapLocation is the location url.
* @param mnirespLoaction is the response location url.
* @param manageNameIdList the live list to be updated.
* @param objFact the Object Factory class.
* @throws JAXBException if save fails.
*/
private void saveSPsoapMni(String mnisoapLocation, String mnirespLoaction, List manageNameIdList, com.sun.identity.saml2.jaxb.metadata.ObjectFactory objFact) throws JAXBException {
if (mnisoapLocation != null && mnisoapLocation.length() > 0) {
ManageNameIDServiceElement slsElemSoap = objFact.createManageNameIDServiceElement();
slsElemSoap.setBinding(soapBinding);
slsElemSoap.setLocation(mnisoapLocation);
slsElemSoap.setResponseLocation(mnirespLoaction);
manageNameIdList.add(slsElemSoap);
}
}
use of com.sun.identity.saml2.jaxb.metadata.ManageNameIDServiceElement in project OpenAM by OpenRock.
the class SAMLv2ModelImpl method savepostMni.
/**
* Saves the Post ManageNameID Service.
*
* @param mnipostLocation is the location url.
* @param mnipostRespLocation is the response location url.
* @param manageNameIdList the live list to be updated.
* @param objFact the Object Factory class.
* @throws JAXBException if save fails.
*/
private void savepostMni(String mnipostLocation, String mnipostRespLocation, List manageNameIdList, com.sun.identity.saml2.jaxb.metadata.ObjectFactory objFact) throws JAXBException {
if (mnipostLocation != null && mnipostLocation.length() > 0) {
ManageNameIDServiceElement slsElemPost = objFact.createManageNameIDServiceElement();
slsElemPost.setBinding(httpPostBinding);
slsElemPost.setLocation(mnipostLocation);
slsElemPost.setResponseLocation(mnipostRespLocation);
manageNameIdList.add(slsElemPost);
}
}
use of com.sun.identity.saml2.jaxb.metadata.ManageNameIDServiceElement in project OpenAM by OpenRock.
the class NameIDMapping method getNameIDMappingService.
/**
* Returns first NameIDMappingService matching specified binding in an
* entity under the realm.
*
* @param realm The realm under which the entity resides.
* @param entityId ID of the entity to be retrieved.
* @param binding bind type need to has to be matched.
* @return <code>ManageNameIDServiceElement</code> for the entity or null
* @throws SAML2MetaException if unable to retrieve the first identity
* provider's SSO configuration.
* @throws SessionException invalid or expired single-sign-on session
*/
public static NameIDMappingServiceElement getNameIDMappingService(String realm, String entityId, String binding) throws SAML2MetaException {
IDPSSODescriptorElement idpSSODesc = metaManager.getIDPSSODescriptor(realm, entityId);
if (idpSSODesc == null) {
SAML2Utils.debug.error(SAML2Utils.bundle.getString("noIDPEntry"));
return null;
}
List list = idpSSODesc.getNameIDMappingService();
NameIDMappingServiceElement nimService = null;
if ((list != null) && !list.isEmpty()) {
if (binding == null) {
return (NameIDMappingServiceElement) list.get(0);
}
Iterator it = list.iterator();
while (it.hasNext()) {
nimService = (NameIDMappingServiceElement) it.next();
if (binding.equalsIgnoreCase(nimService.getBinding())) {
return nimService;
}
}
}
return null;
}
Aggregations