5 Replies Latest reply on Aug 25, 2010 4:57 AM by kobiianko

    Problem: invocation.getCredential() returns empty value in interceptor

    kobiianko

      adding a new interceptor to standardjboss.xml like so:

       

      <container-configuration>
            <container-name>Standard Stateless SessionBean</container-name>
            <call-logging>false</call-logging>
            <invoker-proxy-binding-name>stateless-unified-invoker</invoker-proxy-binding-name>
            <container-interceptors>
              <interceptor>com.allot.nms.common.enterprise.security.SecurityInterceptor</interceptor>

           ...

           ...

      </container-configuration>

       

      the interceptor implementation lokes like this:

       

      package com.allot.nms.common.enterprise.security;

       

      import java.security.Principal;

       

      import org.jboss.ejb.plugins.AbstractInterceptor;
      import org.jboss.invocation.Invocation;

       


      public class SecurityInterceptor extends AbstractInterceptor{

       

         public SecurityInterceptor(){
             super();      
         }

       

      public Object invoke(Invocation invocation)throws Exception{
        
           // Get invoke data

           log.info(invocation.getPrincipal());
           log.info((String)invocation.getCredential());
           log.info(invocation.getMethod().getName());
           log.info(invocation.getMethod().getDeclaringClass().getName());

           ...

           ...
           ...   

           }

      }

       

      In most cases it works fine, but here and there there are cases which the log prints are empty, and my security logic in not working

       

      log print are:

       

      2010-08-10 10:48:29 [main] INFO  enterprise.security.SecurityInterceptor  -
      2010-08-10 10:48:29 [main] INFO  enterprise.security.SecurityInterceptor  -
      2010-08-10 10:48:29 [main] INFO  enterprise.security.SecurityInterceptor  - isInUnit
      2010-08-10 10:48:29 [main] INFO  enterprise.security.SecurityInterceptor  - com.allot.nms.configuration.redundant.ejb.RedundantFacade

       

      Is ther any fix for this? or a bypass?

       

      I'm working with jboss AS 5.1.0, whith ejb2.1 and java 1.6

       

      10x, Kobi