Search code examples
jakarta-eecloudbeesglassfish-4jdbcrealm

How can I define Glassfish jdbcRealm values in Cloudbees


I want to set up jdbc realm for my glassfish app on cloudbees. According to glassfish4 setting JAAS authentication tutorial on cloudbees, it seem cloudbees sets the following values automatically: user_table to cb_users, group_table to cb_groups, etc. Is it possible for me to use my own values eg members instead of cb_users? Thanks in advance.


Solution

  • The cb_users and cb_groups are table or views on which the Glassfish JDBC Realm will perform a SQL lookup to match the users.

    If you need something more sophisticated than basic tables, you can define SQL views. These views and tables must match the Glassfish JDBC Realm requirements. We provide a sample here: https://github.com/CloudBees-community/glassfish4-clickstart/blob/master/src/main/java/localdomain/localhost/JdbcRealmInitializerWebListener.java

    If you want more details on the requirements of the Glassfish JDBC Realm, we recommend you to look at the Glassfish docs and at the source code of Glassfish. I had to look at the source code of Glassfish to write the JdbcRealmInitializerWebListener.java.

    Cyrille