Author: anil.saldhana(a)jboss.com
Date: 2012-01-31 16:49:41 -0500 (Tue, 31 Jan 2012)
New Revision: 1354
Added:
product/trunk/picketlink-core/src/test/resources/parser/saml2/saml2-assertion-subjectconfirmation.xml
Modified:
product/trunk/picketlink-core/src/main/java/org/picketlink/identity/federation/core/parsers/saml/
product/trunk/picketlink-core/src/main/java/org/picketlink/identity/federation/core/parsers/saml/SAMLSubjectParser.java
product/trunk/picketlink-core/src/main/java/org/picketlink/identity/federation/core/parsers/saml/metadata/
product/trunk/picketlink-core/src/main/java/org/picketlink/identity/federation/core/parsers/saml/metadata/SAMLEntityDescriptorParser.java
product/trunk/picketlink-core/src/test/java/org/picketlink/test/identity/federation/core/parser/saml/
product/trunk/picketlink-core/src/test/java/org/picketlink/test/identity/federation/core/parser/saml/SAMLAssertionParserTestCase.java
product/trunk/picketlink-core/src/test/resources/parser/saml2/
Log:
merge in r1327
Property changes on:
product/trunk/picketlink-core/src/main/java/org/picketlink/identity/federation/core/parsers/saml
___________________________________________________________________
Added: svn:mergeinfo
+
/federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/core/parsers/saml:1159-1173,1192-1228
/federation/trunk/picketlink-bindings-jboss/src/main/java/org/picketlink/identity/federation/core/parsers/saml:1159-1173,1192-1228
/federation/trunk/picketlink-fed-api/src/main/java/org/picketlink/identity/federation/core/parsers/saml:1152-1154,1159-1173,1192-1228
/federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/parsers/saml:1152-1173,1192-1228,1327
/federation/trunk/picketlink-fed-model/src/main/java/org/picketlink/identity/federation/core/parsers/saml:1152-1154,1159-1173
/federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/core/parsers/saml:1152-1173
Modified:
product/trunk/picketlink-core/src/main/java/org/picketlink/identity/federation/core/parsers/saml/SAMLSubjectParser.java
===================================================================
---
product/trunk/picketlink-core/src/main/java/org/picketlink/identity/federation/core/parsers/saml/SAMLSubjectParser.java 2012-01-31
21:42:28 UTC (rev 1353)
+++
product/trunk/picketlink-core/src/main/java/org/picketlink/identity/federation/core/parsers/saml/SAMLSubjectParser.java 2012-01-31
21:49:41 UTC (rev 1354)
@@ -110,8 +110,13 @@
StartElement startElement = (StartElement) xmlEvent;
String startTag = StaxParserUtil.getStartElementName(startElement);
- if (startTag.equals(JBossSAMLConstants.SUBJECT_CONFIRMATION_DATA.get()))
+ if (startTag.equals(JBossSAMLConstants.NAMEID.get()))
{
+ NameIDType nameID = SAMLParserUtil.parseNameIDType(xmlEventReader);
+ subjectConfirmationType.setNameID(nameID);
+ }
+ else if
(startTag.equals(JBossSAMLConstants.SUBJECT_CONFIRMATION_DATA.get()))
+ {
SubjectConfirmationDataType subjectConfirmationData =
parseSubjectConfirmationData(xmlEventReader);
subjectConfirmationType.setSubjectConfirmationData(subjectConfirmationData);
}
Property changes on:
product/trunk/picketlink-core/src/main/java/org/picketlink/identity/federation/core/parsers/saml/metadata
___________________________________________________________________
Modified: svn:mergeinfo
-
/federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/core/parsers/saml/metadata:1159-1173,1192-1228
/federation/trunk/picketlink-bindings-jboss/src/main/java/org/picketlink/identity/federation/core/parsers/saml/metadata:1159-1173,1192-1228
/federation/trunk/picketlink-fed-api/src/main/java/org/picketlink/identity/federation/core/parsers/saml/metadata:1152-1154,1159-1173,1192-1228
/federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/parsers/saml/metadata:1095-1096,1152-1173,1192-1228
/federation/trunk/picketlink-fed-model/src/main/java/org/picketlink/identity/federation/core/parsers/saml/metadata:1152-1154,1159-1173
/federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/core/parsers/saml/metadata:1152-1173
+
/federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/core/parsers/saml/metadata:1159-1173,1192-1228
/federation/trunk/picketlink-bindings-jboss/src/main/java/org/picketlink/identity/federation/core/parsers/saml/metadata:1159-1173,1192-1228
/federation/trunk/picketlink-fed-api/src/main/java/org/picketlink/identity/federation/core/parsers/saml/metadata:1152-1154,1159-1173,1192-1228
/federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/parsers/saml/metadata:1095-1096,1152-1173,1192-1228,1327
/federation/trunk/picketlink-fed-model/src/main/java/org/picketlink/identity/federation/core/parsers/saml/metadata:1152-1154,1159-1173
/federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/core/parsers/saml/metadata:1152-1173
Property changes on:
product/trunk/picketlink-core/src/main/java/org/picketlink/identity/federation/core/parsers/saml/metadata/SAMLEntityDescriptorParser.java
___________________________________________________________________
Modified: svn:mergeinfo
-
/federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/core/parsers/saml/metadata/SAMLEntityDescriptorParser.java:1159-1173,1192-1228
/federation/trunk/picketlink-bindings-jboss/src/main/java/org/picketlink/identity/federation/core/parsers/saml/metadata/SAMLEntityDescriptorParser.java:1159-1173,1192-1228
/federation/trunk/picketlink-fed-api/src/main/java/org/picketlink/identity/federation/core/parsers/saml/metadata/SAMLEntityDescriptorParser.java:1152-1154,1159-1173,1192-1228
/federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/parsers/saml/metadata/SAMLEntityDescriptorParser.java:1095-1096,1098-1134,1152-1173,1192-1228
/federation/trunk/picketlink-fed-model/src/main/java/org/picketlink/identity/federation/core/parsers/saml/metadata/SAMLEntityDescriptorParser.java:1152-1154,1159-1173
/federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/core/parsers/saml/metadata/SAMLEntityDescriptorParser.java:1152-1173
+
/federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/core/parsers/saml/metadata/SAMLEntityDescriptorParser.java:1159-1173,1192-1228
/federation/trunk/picketlink-bindings-jboss/src/main/java/org/picketlink/identity/federation/core/parsers/saml/metadata/SAMLEntityDescriptorParser.java:1159-1173,1192-1228
/federation/trunk/picketlink-fed-api/src/main/java/org/picketlink/identity/federation/core/parsers/saml/metadata/SAMLEntityDescriptorParser.java:1152-1154,1159-1173,1192-1228
/federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/parsers/saml/metadata/SAMLEntityDescriptorParser.java:1095-1096,1098-1134,1152-1173,1192-1228,1327
/federation/trunk/picketlink-fed-model/src/main/java/org/picketlink/identity/federation/core/parsers/saml/metadata/SAMLEntityDescriptorParser.java:1152-1154,1159-1173
/federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/core/parsers/saml/metadata/SAMLEntityDescriptorParser.java:1152-1173
Property changes on:
product/trunk/picketlink-core/src/test/java/org/picketlink/test/identity/federation/core/parser/saml
___________________________________________________________________
Modified: svn:mergeinfo
-
/federation/trunk/picketlink-fed-api/src/test/java/org/picketlink/test/identity/federation/core/parser/saml:1192-1228
/federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/parser/saml:1098-1110,1152-1154,1159-1173,1192-1228
+
/federation/trunk/picketlink-fed-api/src/test/java/org/picketlink/test/identity/federation/core/parser/saml:1192-1228
/federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/parser/saml:1098-1110,1152-1154,1159-1173,1192-1228,1327
Modified:
product/trunk/picketlink-core/src/test/java/org/picketlink/test/identity/federation/core/parser/saml/SAMLAssertionParserTestCase.java
===================================================================
---
product/trunk/picketlink-core/src/test/java/org/picketlink/test/identity/federation/core/parser/saml/SAMLAssertionParserTestCase.java 2012-01-31
21:42:28 UTC (rev 1353)
+++
product/trunk/picketlink-core/src/test/java/org/picketlink/test/identity/federation/core/parser/saml/SAMLAssertionParserTestCase.java 2012-01-31
21:49:41 UTC (rev 1354)
@@ -227,4 +227,28 @@
System.out.println(writtenString);
validateSchema(writtenString);
}
+
+ /**
+ * PLFED-251
+ * @throws Exception
+ */
+ @Test
+ public void testSAML2AssertionWithSubjectConfirmationHavingNameID() throws Exception
+ {
+ ClassLoader tcl = Thread.currentThread().getContextClassLoader();
+ InputStream configStream =
tcl.getResourceAsStream("parser/saml2/saml2-assertion-subjectconfirmation.xml");
+
+ SAMLParser parser = new SAMLParser();
+ AssertionType assertion = (AssertionType) parser.parse(configStream);
+ assertNotNull(assertion);
+
+ List<SubjectConfirmationType> subjectConfirmationTypes =
assertion.getSubject().getConfirmation();
+ assertNotNull(subjectConfirmationTypes);
+ assertEquals(1, subjectConfirmationTypes.size());
+ SubjectConfirmationType sct = subjectConfirmationTypes.get(0);
+ assertEquals("urn:oasis:names:tc:SAML:2.0:cm:sender-vouches",
sct.getMethod());
+ NameIDType nameID = sct.getNameID();
+ assertNotNull(nameID);
+ assertEquals("CN=theDUDE", nameID.getValue());
+ }
}
\ No newline at end of file
Property changes on: product/trunk/picketlink-core/src/test/resources/parser/saml2
___________________________________________________________________
Added: svn:mergeinfo
+ /federation/trunk/picketlink-bindings/src/test/resources/parser/saml2:1302-1318
/federation/trunk/picketlink-fed-core/src/test/resources/parser/saml2:1327
Copied:
product/trunk/picketlink-core/src/test/resources/parser/saml2/saml2-assertion-subjectconfirmation.xml
(from rev 1327,
federation/trunk/picketlink-fed-core/src/test/resources/parser/saml2/saml2-assertion-subjectconfirmation.xml)
===================================================================
---
product/trunk/picketlink-core/src/test/resources/parser/saml2/saml2-assertion-subjectconfirmation.xml
(rev 0)
+++
product/trunk/picketlink-core/src/test/resources/parser/saml2/saml2-assertion-subjectconfirmation.xml 2012-01-31
21:49:41 UTC (rev 1354)
@@ -0,0 +1,23 @@
+<saml2:Assertion ID="ID_144fa48dc370c7a921414f3c53ed111b"
+ IssueInstant="2011-11-09T15:04:07.000Z" Version="2.0"
+ xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion">
+
+ <saml2:Issuer>TheDUDE</saml2:Issuer>
+ <saml2:Subject>
+ <saml2:SubjectConfirmation
+ Method="urn:oasis:names:tc:SAML:2.0:cm:sender-vouches">
+ <saml2:NameID>CN=theDUDE</saml2:NameID>
+ </saml2:SubjectConfirmation>
+ </saml2:Subject>
+
+ <saml2:Conditions NotBefore="2011-11-09T15:02:07.000Z"
+ NotOnOrAfter="2011-11-09T15:09:07.000Z" />
+
+ <saml2:AuthnStatement AuthnInstant="2011-11-09T15:04:07.000Z">
+ <saml2:SubjectLocality Address="10.103.121.235" />
+ <saml2:AuthnContext>
+ <saml2:AuthnContextClassRef>urn:oasis:names:tc:SAML:2.0:ac:classes:Password
+ </saml2:AuthnContextClassRef>
+ </saml2:AuthnContext>
+ </saml2:AuthnStatement>
+</saml2:Assertion>
\ No newline at end of file