Hi,
Thank you for creating this topic. However, after some discussion, this issue may be closed. The reason for this is that the same jaas-realm definition can be configured for different security domains. And a single jaas realm should not work with different security domains depending on which deployment is using it.
About the securityIdentity propagation to EJB - since the JAAS realm runs in the management space of the application server and not in a scope of the deployment, it should be done the same way as any other EJB client would do it. So the module that contains the custom LoginModule implementations can have a dependency on the remote interface of that EJB and do the remote invocation