Using JNDI properties might work with other application servers, but that's not the way it is done in JBoss. Your plain Java app should do a JAAS login, using the JBoss ClientLoginModule. This module will take care of passing security information (e.g. user name) to the EJB stubs, so that the EJB container can identify the caller (and you can request this information with getCallerPrincipal()).
It is possible to pass in the login principle and credentials when obtaining the InitialContext: -
The server will still need to be configured to peroform the actual authentication.