There are two ways to use your ldap realm:
a) You can set the name of the targeted realm in you application's deployment descriptor
b) If the application doesn't have a realm configured, glassfish uses the default realm. That can be set via the GlassFish admin console
[Message sent by forum member 'realsnowbird' (realsnowbird)]
http://forums.java.net/jive/thread.jspa?messageID=282204