Author: anil.saldhana(a)jboss.com
Date: 2011-01-04 12:39:13 -0500 (Tue, 04 Jan 2011)
New Revision: 627
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/interfaces/SecurityTokenProvider.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/providers/SAML20AssertionTokenProvider.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/PicketLinkSTSConfiguration.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/plugins/saml/SAML20TokenProvider.java
federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/wstrust/SpecialTokenProvider.java
Log:
add in the QName support in the token providers for config
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/interfaces/SecurityTokenProvider.java
===================================================================
---
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/interfaces/SecurityTokenProvider.java 2011-01-04
17:14:44 UTC (rev 626)
+++
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/interfaces/SecurityTokenProvider.java 2011-01-04
17:39:13 UTC (rev 627)
@@ -23,8 +23,10 @@
import java.util.Map;
+import javax.xml.namespace.QName;
+
import org.picketlink.identity.federation.core.exceptions.ProcessingException;
-import org.picketlink.identity.federation.core.wstrust.WSTrustException;
+import org.picketlink.identity.federation.core.wstrust.WSTrustException;
/**
* <p>
@@ -57,6 +59,12 @@
* @return
*/
public String tokenType();
+
+ /**
+ * Provide an optional {@code QName} for configuration
+ * @return
+ */
+ public QName getSupportedQName();
/**
* <p>
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/providers/SAML20AssertionTokenProvider.java
===================================================================
---
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/providers/SAML20AssertionTokenProvider.java 2011-01-04
17:14:44 UTC (rev 626)
+++
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/providers/SAML20AssertionTokenProvider.java 2011-01-04
17:39:13 UTC (rev 627)
@@ -26,6 +26,7 @@
import java.util.Map;
import javax.xml.datatype.XMLGregorianCalendar;
+import javax.xml.namespace.QName;
import org.picketlink.identity.federation.core.exceptions.ConfigurationException;
import org.picketlink.identity.federation.core.exceptions.ProcessingException;
@@ -33,6 +34,7 @@
import org.picketlink.identity.federation.core.interfaces.SecurityTokenProvider;
import org.picketlink.identity.federation.core.saml.v2.common.IDGenerator;
import org.picketlink.identity.federation.core.saml.v2.common.SAMLProtocolContext;
+import org.picketlink.identity.federation.core.saml.v2.constants.JBossSAMLConstants;
import org.picketlink.identity.federation.core.saml.v2.constants.JBossSAMLURIConstants;
import
org.picketlink.identity.federation.core.saml.v2.exceptions.IssueInstantMissingException;
import org.picketlink.identity.federation.core.saml.v2.factories.SAMLAssertionFactory;
@@ -277,5 +279,13 @@
public String tokenType()
{
return NS;
+ }
+
+ /**
+ * @see
org.picketlink.identity.federation.core.interfaces.SecurityTokenProvider#getSupportedQName()
+ */
+ public QName getSupportedQName()
+ {
+ return new QName( NS, JBossSAMLConstants.ASSERTION.get() );
}
}
\ No newline at end of file
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/PicketLinkSTSConfiguration.java
===================================================================
---
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/PicketLinkSTSConfiguration.java 2011-01-04
17:14:44 UTC (rev 626)
+++
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/PicketLinkSTSConfiguration.java 2011-01-04
17:39:13 UTC (rev 627)
@@ -31,6 +31,8 @@
import java.util.List;
import java.util.Map;
+import javax.xml.namespace.QName;
+
import org.picketlink.identity.federation.core.config.AuthPropertyType;
import org.picketlink.identity.federation.core.config.ClaimsProcessorType;
import org.picketlink.identity.federation.core.config.ClaimsProcessorsType;
@@ -394,6 +396,13 @@
sm.checkPermission( PicketLinkCoreSTS.rte );
tokenProviders.put(key, provider);
+
+ QName tokenQName = provider.getSupportedQName();
+ if( tokenQName != null )
+ {
+ String tokenElementAndNS = tokenQName.getLocalPart() + "$" +
tokenQName.getNamespaceURI() ;
+ this.tokenProviders.put(tokenElementAndNS, provider );
+ }
}
/**
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/plugins/saml/SAML20TokenProvider.java
===================================================================
---
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/plugins/saml/SAML20TokenProvider.java 2011-01-04
17:14:44 UTC (rev 626)
+++
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/plugins/saml/SAML20TokenProvider.java 2011-01-04
17:39:13 UTC (rev 627)
@@ -31,6 +31,7 @@
import org.picketlink.identity.federation.core.interfaces.ProtocolContext;
import org.picketlink.identity.federation.core.interfaces.SecurityTokenProvider;
import org.picketlink.identity.federation.core.saml.v2.common.IDGenerator;
+import org.picketlink.identity.federation.core.saml.v2.constants.JBossSAMLConstants;
import org.picketlink.identity.federation.core.saml.v2.factories.SAMLAssertionFactory;
import org.picketlink.identity.federation.core.saml.v2.util.AssertionUtil;
import org.picketlink.identity.federation.core.saml.v2.util.StatementUtil;
@@ -406,5 +407,13 @@
public String tokenType()
{
return WSTrustConstants.BASE_NAMESPACE;
+ }
+
+ /**
+ * @see
org.picketlink.identity.federation.core.interfaces.SecurityTokenProvider#getSupportedQName()
+ */
+ public QName getSupportedQName()
+ {
+ return new QName( tokenType(), JBossSAMLConstants.ASSERTION.get() );
}
}
\ No newline at end of file
Modified:
federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/wstrust/SpecialTokenProvider.java
===================================================================
---
federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/wstrust/SpecialTokenProvider.java 2011-01-04
17:14:44 UTC (rev 626)
+++
federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/wstrust/SpecialTokenProvider.java 2011-01-04
17:39:13 UTC (rev 627)
@@ -25,6 +25,8 @@
import java.net.URISyntaxException;
import java.util.Map;
+import javax.xml.namespace.QName;
+
import org.picketlink.identity.federation.core.exceptions.ConfigurationException;
import org.picketlink.identity.federation.core.exceptions.ProcessingException;
import org.picketlink.identity.federation.core.interfaces.ProtocolContext;
@@ -165,4 +167,9 @@
{
return WSTrustConstants.BASE_NAMESPACE;
}
+
+ public QName getSupportedQName()
+ {
+ return new QName( tokenType(), "SpecialToken" );
+ }
}
\ No newline at end of file
Show replies by date