You can't configure a security domain from within deployments. However, you can refer to a configured security domain from the deployment.
Isn't it even possible via JMX or so?
I've got one more problem to tackle. My custom LoginModule calls an EJB to perform the actual authentication/authorization check. The problem is that I need to be able to exclude this one bean from the security domain else I run into a chicken-and-egg problem. So how to express this in the jboss-ejb3.xml descriptor? No, I don't want to use the @SecurityDomain annotation on every EJB bean except this one bean. I want them all to live per default within the security domain, except this one bean. My jboss-ejb3.xml looks as follows for the moment:
Unfortunately, I don't a solution for your problem ;-(
I use annotations instead of descriptor files to specify the SecurityDomain of EJBs.
I have a big problem that I can't figure out. Can you take a look at this https://community.jboss.org/thread/177999
PS: sorry to spam your thread!