1 Reply Latest reply on Dec 20, 2015 8:36 AM by Arkady Zelekman

    Wildfly - get username/password from security context into jndi invocation interceptor

    Arkady Zelekman Newbie



      I have a simple client application (not web) which puts username and password into security context and I want to read them from jndi invocation interceptor on Wildfly side.

      My problem is: it comes to my interceptor, but without this information (or I just don't know how to read it).


      My Wildfly version is 8.2.0





      SecurityClient client = SecurityClientFactory.getSecurityClient();


      client.setSimple(myUsername, myPassword);



      Do some jndi invocation.




      public class MyInterceptor {


           SessionContext ctx;



             public Object validate(InvocationContext invocationContext) throws Exception {

                     Principal principal = ctx.getCallerPrincipal(); //NOT CONTAIN myUsername

                     SecurityContextAssociation.getPrincipal(); //NOT CONTAIN myUsername




      P.S. Client application gets username and password as input from user, we don't know in advance which values we can get, so we don't want to add new users into ../configuration/application-users.properties


      May be something is missing in standalone.xml  or something wrong on client application ? (We would prefer not to change code of client application...).


      Do you have any suggestions ?


      Thank you in advance.