In addition to the three built-in realms, you can also create custom realms that store user data in some other way, such as in a relational database. Development of a custom realm is outside the scope of this document. For more information, see Chapter 5, Securing Applications, in Oracle GlassFish Server 3.1 Application Development Guide.
For administration purposes, custom realms are implemented by a class (called the LoginModule) derived from the Java Authentication and Authorization Service (JAAS) package.
Use any unique name for the custom realm, for example myCustomRealm.
realmName { fully-qualified-LoginModule-classname required; };
For example,
myCustomRealm { com.foo.bar.security.customrealm.simpleCustomLoginModule required; };
Check domain-dir/logs/server.log to ensure that the server loaded the realm. The server should invoke the realm’s init method.