Author: sergeyb
Date: Fri Oct 21 15:28:41 2011
New Revision: 1187402
URL: http://svn.apache.org/viewvc?rev=1187402&view=rev
Log:
Merged revisions 1187401 via svnmerge from
https://svn.apache.org/repos/asf/cxf/trunk
........
r1187401 | sergeyb | 2011-10-21 16:27:34 +0100 (Fri, 21 Oct 2011) | 1 line
[CXF-3873] Omitting exception details by default, patch on behalf of Andrei
Shakirin - thanks
........
Modified:
cxf/branches/2.4.x-fixes/ (props changed)
cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/security/AuthenticationException.java
cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/security/JAASLoginInterceptor.java
Propchange: cxf/branches/2.4.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Oct 21 15:28:41 2011
@@ -1 +1 @@
-/cxf/trunk:1187376,1187390
+/cxf/trunk:1187376,1187390,1187401
Propchange: cxf/branches/2.4.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified:
cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/security/AuthenticationException.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/security/AuthenticationException.java?rev=1187402&r1=1187401&r2=1187402&view=diff
==============================================================================
---
cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/security/AuthenticationException.java
(original)
+++
cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/security/AuthenticationException.java
Fri Oct 21 15:28:41 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/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/security/JAASLoginInterceptor.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/security/JAASLoginInterceptor.java?rev=1187402&r1=1187401&r2=1187402&view=diff
==============================================================================
---
cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/security/JAASLoginInterceptor.java
(original)
+++
cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/security/JAASLoginInterceptor.java
Fri Oct 21 15:28:41 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();
+ }
}
}