when I log in to my J2EE web application I would like to use those same credentials to obtain a connection to the database.
So when I configure my data-source, instead of hard-coding the username/password, I would like to specify the <security-domain> to use some security realm to authenticate the user in the database.
Has anyone done this successfully?
the problem I have experienced on the Hibernate side is that when I start Hibernate, it first tries to obtain a connection to the database (ostensibly to make sure the database is available on startup)
Since I have not yet logged in to my application, no UserPrincipal exists, and thus Hibernate fails to obtain a connection. This is a catch-22.
I can see a few possibilities:
* find a way to specify some "default credentials" in the security realm
* find a way to specify default credentials in the datasource
* customize the DatasourceConnectionProvider to provide some default connection when we can't geet a connection, because no UserPrincipal exists
I've tried various things that get into some low-leve weirdness of JBoss, but really, it seems there should be some straightforward 'declarative' way to do this.
_________________ John Pianezze
Telephia
San Francisco
|