Friday, July 22, 2011

*** NOT ADF - Glassfish custom login module

Step 1) Write your custom module - there are enough examples out there - I used (
Step 2) Add to login.conf [glassfish location]\glassfish\domains\[domain name]\config
yourRealm{ required;

Step 3) Admin console setup
  • Goto admin console : http://localhost:4848 and Login
  • Goto Cconfigurations\[Your config]\Security\Realms
  • Click new button
  • ClassName: (choose second custom radio button)
  • Name:     yourRealm
  • Press the ok button
BIG BIG NOTE: (Save yourself hours of time)
Tick Default Principal To Role Mapping in configurations\[Your config]\Security\ and save
stop glassfish
start glasfish

NOTE : When writing a startup script please remeber to start db before start of Assfish otherwise you will have some strange funky errors.


  1. I recommend to package and deploy the CustomRealm as an OSGi module. See for details.