我想保护一些托管在我的 Widlfly AS 上的 ejb,所以我开始创建我的安全域。我不想在 ApplicationRealm 上进行身份验证,所以我定义了我的安全领域并将其指向我的安全域。我想将凭据存储在文本文件中。这是代码:
<security-domain name="mydomain" cache-type="default">
<authentication>
<login-module code="RealmDirect" flag="required"/>
<module-option name="realm" value="myrealm"/>
<module-option name="userProperties" value="${jboss.server.config.dir}/myrealm-users.properties"/>
<module-option name="rolesProperties" value="${jboss.server.config.dir}/myrealm-roles.properties"/>
</authentication>
</security-domain>
看起来我的 ejb 仍然受到“其他”安全域的 ApplicationRealm 的影响。我可以在 Wildfly 中定义自定义安全领域并通过安全域使用它吗?如果是,我该如何添加用户?