The jkniv-jaas-glassfish implements a hybrid realm for authentication and authorization model from JavaTM Authentication and Authorization Service to Glassfish server.
Maven users will need to add the following dependency to their pom.xml for this component:
<dependency> <groupId>net.sf.jkniv</groupId> <artifactId>jkniv-jaas-glassfish</artifactId> <version>0.3.1</version> </dependency>
Copy the jar file jkniv-jaas-glassfish.jar to domain lib glass-install/glassfish4/glassfish/domains/domain1/lib from glassfish.
Edit the file glass-install/glassfish4/glassfish/domains/domain1/config/login.conf to config the hybridRealm. The name hybridRealm must be the same value for jaas-context at Hybrid Realm Properties.
hybridRealm { net.sf.jkniv.jaas.gf.HybridLoginModule required; };
Restart glassfish.
Enter into glassfish console to config the custom realm and add new realm.
Sample entry at glass-install/glassfish4/glassfish/domains/domain1/config/domain.xml:
<login-config> <auth-method>FORM</auth-method> <realm-name>acme-realm</realm-name> <form-login-config> <form-login-page>/login.html</form-login-page> <form-error-page>/error.html</form-error-page> </form-login-config> </login-config>