users@glassfish.java.net

How to bundle an <auth-realm> declaration in .war ? glassfish-resources.xml ?

From: Cyrille Le Clerc <cleclerc_at_cloudbees.com>
Date: Mon, 27 May 2013 15:35:09 +0200

Hello,

Is it possible to bundle an <auth-realm> declaration with a .war file
on glassfish3-latest?

Is it possible to declare an <auth-realm> in glassfish-web.xml,
glassfish-resources.xml or in any other GF3 config file that I can
inject in my .war ? DTDs seem to say it's not possible but who knows.


The JDBC Auth Realm I want to bundle with my .war looks like:

<auth-realm name="jdbc-realm"
classname="com.sun.enterprise.security.auth.realm.jdbc.JDBCRealm">
  <property name="jaas-context" value="jdbcRealm"></property>
  <property name="password-column" value="password"></property>
  <property name="datasource-jndi" value="jdbc/mydb"></property>
  <property name="group-table" value="cb_groups"></property>
  <property name="user-table" value="cb_users"></property>
  <property name="group-name-column" value="groupname"></property>
  <property name="digestrealm-password-enc-algorithm"
value="SHA-256"></property>
  <property name="digest-algorithm" value="SHA-256"></property>
  <property name="user-name-column" value="username"></property>
</auth-realm>

Cyrille