I have an annotation @SecurityDomain("cjm")
on a class. Depending on the environment where I deploy the application, I need to configure different security domains. So my idea was to use filtering: @SecurityDomain("${project.name}")
.
However, using the examples I found on SO, nothing works. I simply cannot replace the property
It seems weird I haven't found a nice solution for this. Probably I am searching with the wrong terminology. Or maybe, weirdly enough, it is (still) not possible.
The maven template plugin is not sufficient, it doesn't contain a filter, so I have many duplicate class compilation errors.
The project is a Java EE project, running on Red Hat EAP 7 using the keycloak saml security adapter. The @SecurityDomain is mandatory to propagate the security context from the web context to the ejb context. This is necessary when using @RolesAllowed. I logged an enhancement request to the keycloak team to automatically propagate the security context, as is done in a default scenario.