-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: using a data-source with <security-domain> to authenti
PostPosted: Mon Aug 29, 2005 8:19 pm 
Newbie

Joined: Wed Mar 31, 2004 6:22 pm
Posts: 4
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.