Author: anil.saldhana(a)jboss.com
Date: 2010-12-01 09:34:05 -0500 (Wed, 01 Dec 2010)
New Revision: 582
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/parsers/util/SAMLParserUtil.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/constants/JBossSAMLURIConstants.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/util/StatementUtil.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/writers/SAMLAssertionWriter.java
federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/saml/v2/X500AttributeUnitTestCase.java
Log:
fixes
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/parsers/util/SAMLParserUtil.java
===================================================================
---
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/parsers/util/SAMLParserUtil.java 2010-12-01
14:14:43 UTC (rev 581)
+++
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/parsers/util/SAMLParserUtil.java 2010-12-01
14:34:05 UTC (rev 582)
@@ -60,8 +60,8 @@
AttributeStatementType attributeStatementType = new AttributeStatementType();
StartElement startElement = StaxParserUtil.getNextStartElement(xmlEventReader);
- String AUTHNSTATEMENT = JBossSAMLConstants.ATTRIBUTE_STATEMENT.get();
- StaxParserUtil.validate( startElement, AUTHNSTATEMENT );
+ String ATTRIBSTATEMT = JBossSAMLConstants.ATTRIBUTE_STATEMENT.get();
+ StaxParserUtil.validate( startElement, ATTRIBSTATEMT );
while( xmlEventReader.hasNext() )
{
@@ -97,7 +97,7 @@
//Look for X500 Encoding
QName x500EncodingName = new QName( JBossSAMLURIConstants.X500_NSURI.get(),
- JBossSAMLConstants.ENCODING.get() );
+ JBossSAMLConstants.ENCODING.get(), JBossSAMLURIConstants.X500_PREFIX.get()
);
Attribute x500EncodingAttr = startElement.getAttributeByName( x500EncodingName );
if( x500EncodingAttr != null )
@@ -156,7 +156,7 @@
{
return StaxParserUtil.getElementText(xmlEventReader);
}
-
+
throw new RuntimeException( "Unsupported xsi:type=" + typeValue );
}
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/constants/JBossSAMLURIConstants.java
===================================================================
---
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/constants/JBossSAMLURIConstants.java 2010-12-01
14:14:43 UTC (rev 581)
+++
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/constants/JBossSAMLURIConstants.java 2010-12-01
14:34:05 UTC (rev 582)
@@ -100,7 +100,8 @@
TRANSFORM_ENVELOPED_SIGNATURE("http://www.w3.org/2000/09/xmldsig#env...,
TRANSFORM_C14N_EXCL_OMIT_COMMENTS("http://www.w3.org/2001/10/xml-exc...,
-
+
+ X500_PREFIX("x500"),
X500_NSURI("urn:oasis:names:tc:SAML:2.0:profiles:attribute:X500"),
XMLSCHEMA_NSURI("http://www.w3.org/2001/XMLSchema"),
XMLDSIG_NSURI("http://www.w3.org/2000/09/xmldsig#"),
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/util/StatementUtil.java
===================================================================
---
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/util/StatementUtil.java 2010-12-01
14:14:43 UTC (rev 581)
+++
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/util/StatementUtil.java 2010-12-01
14:34:05 UTC (rev 582)
@@ -42,7 +42,7 @@
*/
public class StatementUtil
{
- public static final QName X500_QNAME = new
QName(JBossSAMLURIConstants.X500_NSURI.get(), "Encoding");
+ public static final QName X500_QNAME = new
QName(JBossSAMLURIConstants.X500_NSURI.get(), "Encoding",
JBossSAMLURIConstants.X500_PREFIX.get());
/**
* Create an attribute statement with all the attributes
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/writers/SAMLAssertionWriter.java
===================================================================
---
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/writers/SAMLAssertionWriter.java 2010-12-01
14:14:43 UTC (rev 581)
+++
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/writers/SAMLAssertionWriter.java 2010-12-01
14:34:05 UTC (rev 582)
@@ -173,6 +173,7 @@
public void write( StatementAbstractType statement ) throws ProcessingException
{
//TODO: handle this section
+ throw new RuntimeException( "NYI" );
}
public void write( AttributeStatementType statement ) throws ProcessingException
@@ -310,7 +311,7 @@
String nameFormat = attributeType.getNameFormat();
if( StringUtil.isNotNull( nameFormat ))
{
- StaxUtil.writeAttribute( writer, JBossSAMLConstants.NAME_FORMAT.get(),
friendlyName );
+ StaxUtil.writeAttribute( writer, JBossSAMLConstants.NAME_FORMAT.get(),
nameFormat );
}
//Take care of other attributes such as x500:encoding
Modified:
federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/saml/v2/X500AttributeUnitTestCase.java
===================================================================
---
federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/saml/v2/X500AttributeUnitTestCase.java 2010-12-01
14:14:43 UTC (rev 581)
+++
federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/saml/v2/X500AttributeUnitTestCase.java 2010-12-01
14:34:05 UTC (rev 582)
@@ -85,7 +85,9 @@
*///marshaller.marshal(jaxb, System.out);
Document samlDom = DocumentUtil.getDocument(new String(baos.toByteArray()));
- NodeList nl = samlDom.getElementsByTagName("Attribute");
+ System.out.println( DocumentUtil.getDocumentAsString(samlDom));
+
+ NodeList nl =
samlDom.getElementsByTagNameNS(JBossSAMLURIConstants.ASSERTION_NSURI.get()
,"Attribute");
assertEquals("nodes = 2", 2, nl.getLength());
String x500NS = JBossSAMLURIConstants.X500_NSURI.get();