Author: anil.saldhana(a)jboss.com
Date: 2011-07-13 15:34:25 -0400 (Wed, 13 Jul 2011)
New Revision: 1087
Modified:
trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/AbstractPicketLinkTrustHandler.java
trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/SAML2Handler.java
trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/WSAuthenticationHandler.java
Log:
add logging
Modified:
trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/AbstractPicketLinkTrustHandler.java
===================================================================
---
trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/AbstractPicketLinkTrustHandler.java 2011-07-13
00:54:02 UTC (rev 1086)
+++
trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/AbstractPicketLinkTrustHandler.java 2011-07-13
19:34:25 UTC (rev 1087)
@@ -30,6 +30,8 @@
import javax.naming.NamingException;
import javax.security.auth.Subject;
import javax.xml.namespace.QName;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
import org.jboss.logging.Logger;
import org.jboss.security.AuthenticationManager;
@@ -121,6 +123,21 @@
Util.addNamespace(element, Constants.XML_ENCRYPTION_PREFIX,
Constants.XML_SIGNATURE_NS);
return element;
}
+
+ protected void trace(MessageContext msgContext)
+ {
+ if(trace)
+ {
+ if(msgContext instanceof SOAPMessageContext)
+ {
+ SOAPMessageContext soapMessageContext = (SOAPMessageContext) msgContext;
+
log.trace("WSDL_PORT="+soapMessageContext.get(SOAPMessageContext.WSDL_PORT));
+
log.trace("WSDL_OPERATION="+soapMessageContext.get(SOAPMessageContext.WSDL_OPERATION));
+
log.trace("WSDL_INTERFACE="+soapMessageContext.get(SOAPMessageContext.WSDL_INTERFACE));
+
log.trace("WSDL_SERVICE="+soapMessageContext.get(SOAPMessageContext.WSDL_SERVICE));
+ }
+ }
+ }
/**
* Given the NameID {@link Element}, return the user name
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-07-13
00:54:02 UTC (rev 1086)
+++
trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/SAML2Handler.java 2011-07-13
19:34:25 UTC (rev 1087)
@@ -114,26 +114,26 @@
}
if(trace)
- log.trace("Rolekeys to extract roles from the assertion:" +
roleKeys);
+ log.trace("Inbound::Rolekeys to extract roles from the
assertion:" + roleKeys);
List<String> roles = AssertionUtil.getRoles(assertionType, roleKeys);
if(roles.size() > 0 )
{
if(trace)
- log.trace("Roles in the assertion:" + roles);
+ log.trace("Inbound::Roles in the assertion:" + roles);
Group roleGroup = SecurityActions.group(roles);
theSubject.getPrincipals().add(roleGroup);
}
else
{
if(trace)
- log.trace("Did not find roles in the assertion");
+ log.trace("Inbound::Did not find roles in the assertion");
}
}
}
else
{
- log.warn("We did not find any assertion");
+ log.warn("Inbound::We did not find any assertion");
}
return true;
}
@@ -164,7 +164,7 @@
{
if(trace)
{
- log.trace("No Assertion was found on the message context or
authenticated subject. Returning");
+ log.trace("Outbound::No Assertion was found on the message context or
authenticated subject. Returning");
}
return true;
}
Modified:
trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/WSAuthenticationHandler.java
===================================================================
---
trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/WSAuthenticationHandler.java 2011-07-13
00:54:02 UTC (rev 1086)
+++
trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/handler/WSAuthenticationHandler.java 2011-07-13
19:34:25 UTC (rev 1087)
@@ -46,6 +46,7 @@
if(trace)
{
log.trace("Handling Inbound Message");
+ trace(msgContext);
}
AuthenticationManager authenticationManager = getAuthenticationManager();
SecurityAdaptor securityAdaptor = secAdapterfactory.newSecurityAdapter();