servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r899087 - in /servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc: CxfBcConsumer.java interceptors/JbiJAASInterceptor.java
Date Thu, 14 Jan 2010 07:35:40 GMT
Author: ffang
Date: Thu Jan 14 07:35:39 2010
New Revision: 899087

URL: http://svn.apache.org/viewvc?rev=899087&view=rev
Log:
[SMXCOMP-697]add delegateToJaas so that we can disable endpoint delegate to JAASAuthenticationService
to do the authentication if necessary

Modified:
    servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java
    servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiJAASInterceptor.java

Modified: servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java
URL: http://svn.apache.org/viewvc/servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java?rev=899087&r1=899086&r2=899087&view=diff
==============================================================================
--- servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java
(original)
+++ servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java
Thu Jan 14 07:35:39 2010
@@ -179,6 +179,8 @@
     private boolean x509;
     
     private boolean schemaValidationEnabled;
+    
+    private boolean delegateToJaas = true;
 
     /**
      * @return the wsdl
@@ -466,7 +468,7 @@
             cxfService.getInInterceptors().add(new JbiJAASInterceptor(
                     AuthenticationService.Proxy.create(
                         ((CxfBcComponent)this.getServiceUnit().getComponent()).
-                            getConfiguration().getAuthenticationService()), isX509()));
+                            getConfiguration().getAuthenticationService()), isX509(), isDelegateToJaas()));
             cxfService.getInInterceptors().add(new JbiInvokerInterceptor());
             cxfService.getInInterceptors().add(new JbiPostInvokerInterceptor());
 
@@ -1155,4 +1157,20 @@
          return this.providedBus;
      }
 
+     /**
+      * Specifies if the endpoint delegate to JAASAuthenticationService to do the authentication.
+      * 
+      * @param delegateToJaas
+      *            a boolean
+      * @org.apache.xbean.Property description="Specifies if the endpoint delegate to JAASAuthenticationService
to do the authentication.
+      *  Default is <code>true</code>. 
+      */
+     public void setDelegateToJaas(boolean delegateToJaas) {
+         this.delegateToJaas = delegateToJaas;
+     }
+
+     public boolean isDelegateToJaas() {
+         return delegateToJaas;
+     }
+
 }

Modified: servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiJAASInterceptor.java
URL: http://svn.apache.org/viewvc/servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiJAASInterceptor.java?rev=899087&r1=899086&r2=899087&view=diff
==============================================================================
--- servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiJAASInterceptor.java
(original)
+++ servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiJAASInterceptor.java
Thu Jan 14 07:35:39 2010
@@ -42,20 +42,25 @@
     private AuthenticationService authenticationService;
     private ThreadLocal<Subject> currentSubject = new ThreadLocal<Subject>();
     private boolean x509;
+    private boolean delegateToJaas;
     
     
-    public JbiJAASInterceptor(AuthenticationService authenticationService, boolean x509)
{
+    public JbiJAASInterceptor(AuthenticationService authenticationService, boolean x509,
boolean delegateToJaas) {
         super();
         setPhase(Phase.PRE_PROTOCOL);
         getAfter().add(WSS4JInInterceptor.class.getName());
         this.authenticationService = authenticationService;
         this.x509 = x509;
+        this.delegateToJaas = delegateToJaas;
     }
     
     
     public void handleMessage(SoapMessage message) throws Fault {
      
         try {
+            if (!delegateToJaas) {
+                return;
+            }
             Subject subject = (Subject) currentSubject.get();
             
             if (subject == null) {



Mime
View raw message