Skip to content

Commit 912c2a9

Browse files
sgramponeBeta Bot
authored andcommitted
Cherry pick branch 'genexuslabs:gamsaml20' into beta
1 parent e687370 commit 912c2a9

File tree

2 files changed

+2
-91
lines changed

2 files changed

+2
-91
lines changed

gamsaml20/src/main/java/com/genexus/saml20/utils/PolicyFormat.java

Lines changed: 0 additions & 87 deletions
This file was deleted.

gamsaml20/src/main/java/com/genexus/saml20/utils/SamlAssertionUtils.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ public static Document createLoginRequest(String id, String destination, String
105105
String samlp = "urn:oasis:names:tc:SAML:2.0:protocol";
106106
String saml = "urn:oasis:names:tc:SAML:2.0:assertion";
107107

108-
PolicyFormat pf = PolicyFormat.getPolicyFormat(policyFormat);
109108

110109
DocumentBuilder builder = createDocumentBuilder();
111110

@@ -126,8 +125,7 @@ public static Document createLoginRequest(String id, String destination, String
126125
request.appendChild(issuerElem);
127126

128127
org.w3c.dom.Element policy = doc.createElementNS(samlp, "saml2p:NameIDPolicy");
129-
assert pf != null;
130-
policy.setAttribute("Format", PolicyFormat.getPolicyFormatXmlValue(pf));
128+
policy.setAttribute("Format", policyFormat.trim());
131129
policy.setAttribute("AllowCreate", "true");
132130
policy.setAttribute("SPNameQualifier", spname);
133131
request.appendChild(policy);
@@ -220,7 +218,7 @@ public static String getLoginAttribute(Document doc, String name) {
220218

221219
for (int i = 0; i < nodes.getLength(); i++) {
222220
if (nodes.item(i).getAttributes().getNamedItem("Name").getNodeValue().equals(name)) {
223-
String value = getAttributeContent(nodes.item(i));
221+
String value = nodes.item(i).getTextContent() == null ? getAttributeContent(nodes.item(i)): nodes.item(i).getTextContent();
224222
logger.debug(MessageFormat.format("getLoginAttribute -- attribute name: {0}, value: {1}", name, value));
225223
return value;
226224
}

0 commit comments

Comments
 (0)