2
votes

I'd like to authenticate users using both JDBC and LDAP connections. In the database I have usernames, roles, and a flag indicating if the user is allowed to log in.

NAME  | ROLE | ALLOWED
user1 | r1   | 1
user2 | r1   | 0
user3 | r4   | 1

The LDAP server has the passwords.

I'd like to have the following authentication: If the user is in the database and the allowed flag is 1, then ask the LDAP server for authentication. Is it possible?

1

1 Answers

1
votes

Not sure with basic realms within default Glassfish setup but this definitely can be implemented with custom Realm and LoginModule.

See http://docs.oracle.com/cd/E19226-01/820-7695/beabs/index.html for details.