From this thread and the answers from Darran Lofthouse I understand that to be able to secure an EJB you must at least secure the remoting connector.
(security-realm="ApplicationRelam" parameter on the tag '<connector name="remoting-connector" socket-binding="remoting" security-realm="AguraRealm"/>' in standalone.xml)
So the question arises: If I would like to allow remote unauthenticated access to EJB-One but would like to secure EJB-Two (by annotating it with an @SecurityDomain for example), is that even possible?
If I need to secure the remoting connector just to be able to secure EJB-Two, I can't have unauthenticated access to EJB-One. If I remove the security-realm="ApplicationRealm" from remoting connector to allow unautenticated access to EJB-One, any authentication credentials will never reach login module configured for the @SecurityDomain to secure EJB-Two as explained in the earlier mentioned forum thread (if I understood that discussion correctly).
So is this use case covered or just not possible in JBoss 7.1.x?
You mean one security domain for JBOSS remoting, one security domain for my normal EJBs, stateless ejbs for example
If you mean that, i couldn't pass my credentials to my custom security domain by using JAAS. I'm working on a remote client which uses EJBs hosted in JBOSS 7.1.1 container. I couldn't find a suitable login module, so i wrote one. For JBOSS remoting i use ApplicationRealms that is predefined in JBOSS. I use my custom login module for my ejbs. I create my credentials by using JAAS on the client. When i debug the server, my custom login module is running, however my credentials are not given to my login module. In previous releases of JBOSS there was no problem with this method. I was able to send my credentials to JBOSS by using JAAS and use these information in my custom login module.
Serkam, no I didn't solve this issue yet.
Regarding your second question: I'm not sure why you are not receiving credentials at your custom login module.
The thread I'm refering to in my original question proofed to be really helpfull for me to get my custom login module working. You might also want to have a look at: https://community.jboss.org/thread/176963
If the problem persist please open a new thread to keep this thread on one subject.