Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B66E211724 for ; Fri, 10 May 2013 17:10:49 +0000 (UTC) Received: (qmail 97006 invoked by uid 500); 10 May 2013 17:10:49 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 96958 invoked by uid 500); 10 May 2013 17:10:49 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 96951 invoked by uid 99); 10 May 2013 17:10:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 May 2013 17:10:49 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 May 2013 17:10:48 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 50C622388900; Fri, 10 May 2013 17:10:28 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1481103 - /cxf/trunk/rt/security/src/main/java/org/apache/cxf/rt/security/xacml/AbstractXACMLAuthorizingInterceptor.java Date: Fri, 10 May 2013 17:10:28 -0000 To: commits@cxf.apache.org From: coheigea@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130510171028.50C622388900@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: coheigea Date: Fri May 10 17:10:27 2013 New Revision: 1481103 URL: http://svn.apache.org/r1481103 Log: Log XACML Request at level.FINE Modified: cxf/trunk/rt/security/src/main/java/org/apache/cxf/rt/security/xacml/AbstractXACMLAuthorizingInterceptor.java Modified: cxf/trunk/rt/security/src/main/java/org/apache/cxf/rt/security/xacml/AbstractXACMLAuthorizingInterceptor.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/security/src/main/java/org/apache/cxf/rt/security/xacml/AbstractXACMLAuthorizingInterceptor.java?rev=1481103&r1=1481102&r2=1481103&view=diff ============================================================================== --- cxf/trunk/rt/security/src/main/java/org/apache/cxf/rt/security/xacml/AbstractXACMLAuthorizingInterceptor.java (original) +++ cxf/trunk/rt/security/src/main/java/org/apache/cxf/rt/security/xacml/AbstractXACMLAuthorizingInterceptor.java Fri May 10 17:10:27 2013 @@ -26,7 +26,11 @@ import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + import org.apache.cxf.common.logging.LogUtils; +import org.apache.cxf.helpers.DOMUtils; import org.apache.cxf.interceptor.Fault; import org.apache.cxf.interceptor.security.AccessDeniedException; import org.apache.cxf.message.Message; @@ -35,6 +39,7 @@ import org.apache.cxf.phase.Phase; import org.apache.cxf.security.LoginSecurityContext; import org.apache.cxf.security.SecurityContext; import org.apache.ws.security.saml.ext.OpenSAMLUtil; +import org.apache.ws.security.util.DOM2Writer; import org.opensaml.xacml.ctx.DecisionType; import org.opensaml.xacml.ctx.RequestType; import org.opensaml.xacml.ctx.ResponseType; @@ -85,6 +90,12 @@ public abstract class AbstractXACMLAutho LOG.log(Level.FINE, "Unauthorized: " + e.getMessage(), e); throw new AccessDeniedException("Unauthorized"); } + } else { + LOG.log( + Level.FINE, + "The SecurityContext was not an instance of LoginSecurityContext. No authorization " + + "is possible as a result" + ); } throw new AccessDeniedException("Unauthorized"); @@ -105,6 +116,11 @@ public abstract class AbstractXACMLAutho Principal principal, List roles, Message message ) throws Exception { RequestType request = requestBuilder.createRequest(principal, roles, message); + if (LOG.isLoggable(Level.FINE)) { + Document doc = DOMUtils.createDocument(); + Element requestElement = OpenSAMLUtil.toDom(request, doc); + LOG.log(Level.FINE, DOM2Writer.nodeToString(requestElement)); + } ResponseType response = performRequest(request, message);