Author: anil.saldhana(a)jboss.com
Date: 2011-03-21 18:14:37 -0400 (Mon, 21 Mar 2011)
New Revision: 824
Modified:
trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/SAML2Handler.java
Log:
use PL constants
Modified:
trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/SAML2Handler.java
===================================================================
---
trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/SAML2Handler.java 2011-03-16
20:06:26 UTC (rev 823)
+++
trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/SAML2Handler.java 2011-03-21
22:14:37 UTC (rev 824)
@@ -35,6 +35,7 @@
import org.jboss.security.SecurityContext;
import org.jboss.wsf.common.handler.GenericSOAPHandler;
import org.picketlink.identity.federation.bindings.jboss.subject.PicketLinkPrincipal;
+import org.picketlink.identity.federation.core.saml.v2.constants.JBossSAMLURIConstants;
import org.picketlink.identity.federation.core.wstrust.SamlCredential;
import org.picketlink.trust.jbossws.Constants;
import org.picketlink.trust.jbossws.SAML2Constants;
@@ -49,8 +50,10 @@
*
* @author <a href="mmoyses(a)redhat.com">Marcus Moyses</a>
* @author <a href="alessio.soldano(a)jboss.com">Alessio Soldano</a>
+ * @author Anil Saldhana
* @version $Revision: 1 $
*/
+@SuppressWarnings({"rawtypes", "restriction"})
public class SAML2Handler extends GenericSOAPHandler
{
@@ -76,13 +79,14 @@
*/
protected boolean handleInbound(MessageContext msgContext)
{
+ String assertionNS = JBossSAMLURIConstants.ASSERTION_NSURI.get();
SOAPMessageContext ctx = (SOAPMessageContext) msgContext;
SOAPMessage soapMessage = ctx.getMessage();
// retrieve the assertion
Document document = soapMessage.getSOAPPart();
Element soapHeader = Util.findOrCreateSoapHeader(document.getDocumentElement());
- Element assertion = Util.findElement(soapHeader, new
QName(SAML2Constants.SAML2_ASSERTION_URI, "Assertion"));
+ Element assertion = Util.findElement(soapHeader, new QName(assertionNS,
"Assertion"));
if (assertion != null)
{
SamlCredential credential = new SamlCredential(assertion);
@@ -91,8 +95,8 @@
log.trace("Assertion included in SOAP payload:");
log.trace(credential.getAssertionAsString());
}
- Element subject = Util.findElement(assertion, new
QName(SAML2Constants.SAML2_ASSERTION_URI, "Subject"));
- Element nameID = Util.findElement(subject, new
QName(SAML2Constants.SAML2_ASSERTION_URI, "NameID"));
+ Element subject = Util.findElement(assertion, new QName(assertionNS,
"Subject"));
+ Element nameID = Util.findElement(subject, new QName(assertionNS,
"NameID"));
String username = getUsername(nameID);
// set SecurityContext
Subject s = new Subject();
Show replies by date