Leverage JAAS security realm via custom realm resource in EAP 7.4.16+

Updated -

The JAAS realm can be used via the custom-realm resource by referencing the org.wildfly.extension.elytron.jaas-realm module.

Example of using the JAAS security realm in EAP 7.4.16 via a custom-realm resource:

[standalone@localhost:9990 /] module add --name=jaasLoginModule --resources=path/to/login/modules/jar --dependencies=org.wildfly.security.elytron

[standalone@localhost:9990 /] /subsystem=elytron/custom-realm=myRealm:add(module=org.wildfly.extension.elytron.jaas-realm,class-name=org.wildfly.extension.elytron.JaasCustomSecurityRealmWrapper,configuration={entry=Entry1,module=jaasLoginModule,callback-handler=org.example.ExampleCallbackHandler,path=/my/example/path,relative-to=jboss.server.config.dir})

Note the use of the org.wildfly.extension.elytron.jaas-realm module and the org.wildfly.extension.elytron.JaasCustomSecurityRealmWrapper class. These are needed for this feature. The custom-realm configuration must contain the attributes that would normally be provided directly to the jaas-realm resource. The names are the same as well as whether the attribute is required or not.

This functionality will remain in EAP 8+, but note that in EAP 8+ the jaas-realm resource can be used directly and is preferred.

Comments