Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
import com.sun.identity.saml2.jaxb.entityconfig.SPSSOConfigElement;
import com.sun.identity.saml2.jaxb.metadata.IDPSSODescriptorElement;
import com.sun.identity.saml2.jaxb.metadata.SPSSODescriptorElement;
import com.sun.identity.saml2.jaxb.metadata.SingleSignOnServiceElement;
import com.sun.identity.saml2.jaxb.metadata.EndpointType;
import com.sun.identity.saml2.key.KeyUtil;
import com.sun.identity.saml2.meta.SAML2MetaException;
import com.sun.identity.saml2.meta.SAML2MetaManager;
Expand Down Expand Up @@ -222,8 +222,8 @@ private int initiateSAMLLoginAtIDP(final HttpServletResponse response, final Htt
bundle.getString("samlLocalConfigFailed"));
}

List<SingleSignOnServiceElement> ssoServiceList = idpsso.getSingleSignOnService();
final SingleSignOnServiceElement endPoint = SPSSOFederate
List<EndpointType> ssoServiceList = idpsso.getSingleSignOnService();
final EndpointType endPoint = SPSSOFederate
.getSingleSignOnServiceEndpoint(ssoServiceList, reqBinding);

if (endPoint == null || StringUtils.isEmpty(endPoint.getLocation())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@

import com.sun.identity.saml2.common.SAML2Constants;
import com.sun.identity.shared.encode.URLEncDec;
import com.sun.xml.bind.StringInputStream;

import java.io.ByteArrayInputStream;
import java.nio.charset.StandardCharsets;

import jakarta.servlet.http.Cookie;
import jakarta.servlet.http.HttpServletRequest;
Expand Down Expand Up @@ -95,7 +97,8 @@ public void shouldEscapeMaliciousHtmlInputOnForm() {

private String getFormAction(String html) {
try {
final Document doc = XMLUtils.getSafeDocumentBuilder(false).parse(new StringInputStream(html));
final Document doc = XMLUtils.getSafeDocumentBuilder(false).parse(
new ByteArrayInputStream(html.getBytes(StandardCharsets.UTF_8)));
return XPathFactory.newInstance().newXPath().evaluate("string(//form/@action)", doc);
} catch (Exception e) {
throw new RuntimeException(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.xml.bind.JAXBException;
import jakarta.xml.bind.JAXBException;

/**
* Create Meta Data Template.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
import java.io.OutputStream;
import java.io.PrintWriter;
import java.text.MessageFormat;
import javax.xml.bind.JAXBException;
import jakarta.xml.bind.JAXBException;
import org.w3c.dom.Document;
import java.util.logging.Level;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import javax.xml.bind.JAXBException;
import jakarta.xml.bind.JAXBException;

import org.forgerock.openam.utils.CollectionUtils;
import org.forgerock.openam.utils.StringUtils;
Expand Down Expand Up @@ -318,7 +318,9 @@ private void handleWSFedRequest(RequestContext rc)
*/
if (configElt != null && configElt.isHosted()) {
List<com.sun.identity.wsfederation.jaxb.entityconfig.BaseConfigType> config =
configElt.getIDPSSOConfigOrSPSSOConfig();
configElt.getIDPSSOConfigOrSPSSOConfig().stream()
.map(jakarta.xml.bind.JAXBElement::getValue)
.collect(java.util.stream.Collectors.toList());
if (CollectionUtils.isNotEmpty(config)) {
realm = WSFederationMetaUtils.getRealmByMetaAlias(config.get(0).getMetaAlias());
newMetaAliases = getMetaAliasesWsFed(config);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
import java.util.Map;
import java.util.Set;
import jakarta.servlet.http.HttpServletRequest;
import javax.xml.bind.JAXBException;
import jakarta.xml.bind.JAXBException;

public class CreateMetaDataModelImpl extends AMModelBase
implements CreateMetaDataModel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
import java.util.Map;
import java.util.Set;
import jakarta.servlet.http.HttpServletRequest;
import javax.xml.bind.JAXBException;
import jakarta.xml.bind.JAXBException;

public class IDFFModelImpl
extends EntityModelImpl
Expand Down Expand Up @@ -690,7 +690,7 @@ public void updateEntitySPDescriptor(
(String) AMAdminUtils.getValue((Set) attrValues.get(
ATTR_FEDERATION_TERMINATION_NOTIFICATION_PROTOCOL_PROFILE)))) {
pDesc.getFederationTerminationNotificationProtocolProfile().add(
federationTerminationProfileList.get(i));
(String) federationTerminationProfileList.get(i));
}
}

Expand All @@ -704,7 +704,7 @@ public void updateEntitySPDescriptor(
(String) AMAdminUtils.getValue((Set) attrValues.get(
ATTR_SINGLE_LOGOUT_PROTOCOL_PROFILE)))) {
pDesc.getSingleLogoutProtocolProfile().add(
singleLogoutProfileList.get(i));
(String) singleLogoutProfileList.get(i));
}
}

Expand All @@ -718,7 +718,7 @@ public void updateEntitySPDescriptor(
(String) AMAdminUtils.getValue((Set) attrValues.get(
ATTR_REGISTRATION_NAME_IDENTIFIER_PROFILE_PROFILE)))) {
pDesc.getRegisterNameIdentifierProtocolProfile().add(
nameRegistrationProfileList.get(i));
(String) nameRegistrationProfileList.get(i));
}
}

Expand Down Expand Up @@ -762,14 +762,6 @@ public void updateEntitySPDescriptor(
{realm, entityName, "IDFF", "SP-Standard Metadata", strError};
logEvent("FEDERATION_EXCEPTION_MODIFY_ENTITY_DESCRIPTOR", paramsEx);
throw new AMConsoleException(strError);
} catch (JAXBException e) {
debug.error("JAXBException, updateEntitySPDescriptor");
String strError = getErrorString(e);
String[] paramsEx =
{realm, entityName, "IDFF", "SP-Standard Metadata", strError};
logEvent("FEDERATION_EXCEPTION_MODIFY_ENTITY_DESCRIPTOR", paramsEx);
throw new AMConsoleException(strError);

}
}

Expand Down Expand Up @@ -849,7 +841,7 @@ public void updateEntityIDPDescriptor(
(String) AMAdminUtils.getValue((Set) attrValues.get(
ATTR_FEDERATION_TERMINATION_NOTIFICATION_PROTOCOL_PROFILE)))) {
pDesc.getFederationTerminationNotificationProtocolProfile().add(
federationTerminationProfileList.get(i));
(String) federationTerminationProfileList.get(i));
}
}

Expand All @@ -863,7 +855,7 @@ public void updateEntityIDPDescriptor(
(String) AMAdminUtils.getValue((Set) attrValues.get(
ATTR_SINGLE_LOGOUT_PROTOCOL_PROFILE)))) {
pDesc.getSingleLogoutProtocolProfile().add(
singleLogoutProfileList.get(i));
(String) singleLogoutProfileList.get(i));
}
}

Expand All @@ -877,7 +869,7 @@ public void updateEntityIDPDescriptor(
(String) AMAdminUtils.getValue((Set) attrValues.get(
ATTR_REGISTRATION_NAME_IDENTIFIER_PROFILE_PROFILE)))) {
pDesc.getRegisterNameIdentifierProtocolProfile().add(
nameRegistrationProfileList.get(i));
(String) nameRegistrationProfileList.get(i));
}
}

Expand All @@ -891,7 +883,7 @@ public void updateEntityIDPDescriptor(
(String) AMAdminUtils.getValue((Set) attrValues.get(
ATTR_SINGLE_SIGN_ON_PROTOCOL_PROFILE)))) {
pDesc.getSingleSignOnProtocolProfile().add(
federationProfileList.get(i));
(String) federationProfileList.get(i));
}

}
Expand Down Expand Up @@ -1418,8 +1410,6 @@ public void createEntityConfig(
idffMetaMgr.setEntityConfig(realm, entityConfig);
} catch (IDFFMetaException e) {
throw new AMConsoleException(getErrorString(e));
} catch (JAXBException e) {
throw new AMConsoleException(getErrorString(e));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
import com.sun.identity.workflow.WorkflowException;
import java.util.List;
import java.util.Map;
import javax.xml.bind.JAXBException;
import jakarta.xml.bind.JAXBException;
import jakarta.servlet.http.HttpServletRequest;
import org.w3c.dom.Document;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
import com.sun.identity.saml2.jaxb.xmlenc.EncryptionMethodType;
import com.sun.identity.shared.datastruct.OrderedSet;
import com.sun.identity.console.federation.SAMLv2AuthContexts;
import javax.xml.bind.JAXBException;
import jakarta.xml.bind.JAXBException;

import org.apache.xml.security.encryption.XMLCipher;
import org.forgerock.openam.utils.StringUtils;
Expand Down Expand Up @@ -923,7 +923,7 @@ public AssertionConsumerServiceElement getAscObject()
try {
acsElem = objFact.createAssertionConsumerServiceElement();

} catch (JAXBException e) {
} catch (Exception e) {
if (debug.warningEnabled()) {
debug.warning("SAMLv2ModelImpl.getAscObject:", e);
}
Expand Down Expand Up @@ -1706,7 +1706,7 @@ private void saveNameIdFormat(
(Set)values.get(NAMEID_FORMAT));
ssodescriptor.getNameIDFormat().clear();
for (int i=0; i<listtoSave.size();i++) {
ssodescriptor.getNameIDFormat().add(listtoSave.get(i));
ssodescriptor.getNameIDFormat().add((String)listtoSave.get(i));
}
}

Expand All @@ -1724,7 +1724,7 @@ private void getKeyandAlgorithm(
for (int i=0; i<keyList.size(); i++) {
KeyDescriptorElement keyOne =
(KeyDescriptorElement)keyList.get(i);
String type = keyOne.getUse();
String type = (keyOne.getUse() != null) ? keyOne.getUse().value() : null;
if ((type == null) || (type.length() == 0) ||
type.equals("encryption")) {
List encryptMethod = keyOne.getEncryptionMethod();
Expand All @@ -1738,13 +1738,16 @@ private void getKeyandAlgorithm(
for (Iterator itt = keySizeList.listIterator();
itt.hasNext(); ) {
Object encrptType = (Object)itt.next();
if (encrptType.getClass().getName().
contains("KeySizeImpl")) {
EncryptionMethodType.KeySize keysizeElem =
(EncryptionMethodType.KeySize)
keySizeList.get(0);
BigInteger keysize = keysizeElem.getValue();
size = Integer.toString(keysize.intValue());
// JAXB 4.x: KeySize is unmarshaled as JAXBElement<BigInteger>
if (encrptType instanceof BigInteger) {
size = Integer.toString(((BigInteger) encrptType).intValue());
} else if (encrptType instanceof jakarta.xml.bind.JAXBElement) {
@SuppressWarnings("unchecked")
jakarta.xml.bind.JAXBElement<BigInteger> ksElem =
(jakarta.xml.bind.JAXBElement<BigInteger>) encrptType;
if (ksElem.getValue() instanceof BigInteger) {
size = Integer.toString(ksElem.getValue().intValue());
}
}
}
}
Expand Down Expand Up @@ -2951,13 +2954,6 @@ public void setStdAttributeAuthorityValues(
logEvent("FEDERATION_EXCEPTION_MODIFY_ATTR_AUTH_ATTR_VALUES",
paramsEx);
throw new AMConsoleException(strError);
} catch (JAXBException e) {
debug.warning("SAMLv2ModelImpl.setStdAttributeAuthorityValues:", e);
String strError = getErrorString(e);
String[] paramsEx =
{realm, entityName, "SAMLv2", "AttribAuthority-Std", strError};
logEvent("FEDERATION_EXCEPTION_MODIFY_ATTR_AUTH_ATTR_VALUES",
paramsEx);
}
}

Expand Down Expand Up @@ -3104,13 +3100,6 @@ public void setStdAuthnAuthorityValues(
logEvent("FEDERATION_EXCEPTION_MODIFY_AUTHN_AUTH_ATTR_VALUES",
paramsEx);
throw new AMConsoleException(strError);
} catch (JAXBException e) {
debug.warning("SAMLv2ModelImpl.setStdAttributeAuthorityValues:", e);
String strError = getErrorString(e);
String[] paramsEx =
{realm, entityName, "SAMLv2", "AttribAuthority-Std", strError};
logEvent("FEDERATION_EXCEPTION_MODIFY_AUTHN_AUTH_ATTR_VALUES",
paramsEx);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
import com.sun.identity.wsfederation.jaxb.wsfederation.TokenIssuerNameElement;
import com.sun.identity.wsfederation.jaxb.entityconfig.ObjectFactory;
import java.util.Set;
import javax.xml.bind.JAXBException;
import jakarta.xml.bind.JAXBException;
import jakarta.servlet.http.HttpServletRequest;
import java.util.Collections;
import java.util.HashMap;
Expand Down Expand Up @@ -719,9 +719,6 @@ private void createExtendedObject(
}
metaManager.setEntityConfig(realm,ele);
}
} catch (JAXBException e) {
debug.warning("WSFedPropertiesModelImpl.createExtendedObject", e);
throw new AMConsoleException(getErrorString(e));
} catch (WSFederationMetaException e) {
debug.warning("WSFedPropertiesModelImpl.createExtendedObject", e);
throw new AMConsoleException(getErrorString(e));
Expand All @@ -739,19 +736,13 @@ private BaseConfigType createAttributeElement(
Map values,
BaseConfigType bconfig
)throws AMConsoleException {
try {
ObjectFactory objFactory = new ObjectFactory();
for (Iterator iter=values.keySet().iterator();
iter.hasNext();) {
AttributeElement avp = objFactory.createAttributeElement();
String key = (String)iter.next();
avp.setName(key);
bconfig.getAttribute().add(avp);
}
} catch (JAXBException e) {
debug.warning
("WSFedPropertiesModelImpl.createAttributeElement", e);
throw new AMConsoleException(e.getMessage());
ObjectFactory objFactory = new ObjectFactory();
for (Iterator iter=values.keySet().iterator();
iter.hasNext();) {
AttributeElement avp = objFactory.createAttributeElement();
String key = (String)iter.next();
avp.setName(key);
bconfig.getAttribute().add(avp);
}
return bconfig;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import jakarta.xml.bind.JAXBContext;
import jakarta.xml.bind.JAXBException;
import jakarta.xml.bind.Marshaller;
import javax.xml.namespace.QName;

/* - NEED NOT LOG - */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import jakarta.xml.bind.JAXBContext;
import jakarta.xml.bind.JAXBException;
import jakarta.xml.bind.Unmarshaller;
import org.xml.sax.InputSource;

/* - NEED NOT LOG - */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ private boolean createFolder(String debugDirectory) {
.separator + RecordConstants.INFO_FILE_NAME));

previousRecordDate = recordReport.getDateFromInfoReport(infoJson);
} catch (IOException | ParseException | JsonValueException e) {
} catch (IOException | IllegalArgumentException | ParseException | JsonValueException e) {
debug.error("Can't extract starting date from previous record. We will use the current date instead",
e);
previousRecordDate = newDate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@
import java.util.Set;
import java.util.TimeZone;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
import jakarta.xml.bind.JAXBContext;
import jakarta.xml.bind.JAXBElement;
import jakarta.xml.bind.JAXBException;
import jakarta.xml.bind.Marshaller;
import jakarta.xml.bind.Unmarshaller;
import javax.xml.namespace.QName;

import org.forgerock.util.annotations.VisibleForTesting;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import java.util.HashMap;
import java.util.Map;

import javax.xml.bind.JAXBException;
import jakarta.xml.bind.JAXBException;

import org.forgerock.openam.entitlement.ResourceType;
import org.json.JSONException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import com.sun.identity.entitlement.xacml3.core.EffectType;
import com.sun.identity.entitlement.xacml3.core.ObjectFactory;

import javax.xml.bind.JAXBElement;
import jakarta.xml.bind.JAXBElement;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
Expand Down
Loading