cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1187401 - in /cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/security: AuthenticationException.java JAASLoginInterceptor.java
Date Fri, 21 Oct 2011 15:27:34 GMT
Author: sergeyb
Date: Fri Oct 21 15:27:34 2011
New Revision: 1187401

URL: http://svn.apache.org/viewvc?rev=1187401&view=rev
Log:
[CXF-3873] Omitting exception details by default, patch on behalf of Andrei Shakirin - thanks

Modified:
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/security/AuthenticationException.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/security/JAASLoginInterceptor.java

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/security/AuthenticationException.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/security/AuthenticationException.java?rev=1187401&r1=1187400&r2=1187401&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/security/AuthenticationException.java
(original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/security/AuthenticationException.java
Fri Oct 21 15:27:34 2011
@@ -19,6 +19,9 @@
 package org.apache.cxf.interceptor.security;
 
 public class AuthenticationException extends SecurityException {
+    public AuthenticationException() {
+    }
+    
     public AuthenticationException(String reason) {
         super(reason);
     }

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/security/JAASLoginInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/security/JAASLoginInterceptor.java?rev=1187401&r1=1187400&r2=1187401&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/security/JAASLoginInterceptor.java
(original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/security/JAASLoginInterceptor.java
Fri Oct 21 15:27:34 2011
@@ -45,6 +45,7 @@ public class JAASLoginInterceptor extend
     
     private String contextName;
     private String rolePrefix;
+    private boolean reportFault;
     
     public JAASLoginInterceptor() {
         super(Phase.UNMARSHAL);
@@ -66,6 +67,10 @@ public class JAASLoginInterceptor extend
         return rolePrefix;
     }
     
+    public void setReportFault(boolean reportFault) {
+        this.reportFault = reportFault;
+    }
+    
     public void handleMessage(Message message) throws Fault {
 
         String name = null;
@@ -91,7 +96,11 @@ public class JAASLoginInterceptor extend
                                                        BUNDLE, 
                                                        name, password);
             LOG.warning(errorMsg.toString());
-            throw new SecurityException(errorMsg.toString());
+            if (reportFault) {
+                throw new SecurityException(errorMsg.toString());
+            } else {
+                throw new SecurityException();
+            }
         }
         
         try {
@@ -105,7 +114,11 @@ public class JAASLoginInterceptor extend
         } catch (LoginException ex) {
             String errorMessage = "Unauthorized : " + ex.getMessage();
             LOG.fine(errorMessage.toString());
-            throw new AuthenticationException(errorMessage);
+            if (reportFault) {
+                throw new AuthenticationException(errorMessage);
+            } else {
+                throw new AuthenticationException();
+            }
         }
     }
 



Mime
View raw message