JAAS AuthN Module DB Connection
Etienne Dysli-Metref
etienne.dysli-metref at switch.ch
Mon Dec 7 07:17:59 EST 2015
On 07/12/15 11:29, Callum Smith wrote:
> Is it possible/advisable to pull down a global DB connection bean
> defined in global.xml for use in this context?
I'd say that's not really possible in an elegant way. JAAS LoginModule
instances are created by the JVM from the JAAS configuration when you
use that API. They are not created by the Spring Framework so it can't
inject any references in them. The hackish way around this could be to
make your LoginModule class look for a Spring ApplicationContext and
call getBean() on it to obtain a DB connection pool reference, but this
creates a strong dependency between the LoginModule and Spring... Or
more complicated: intercept instantiation of LoginModules with AOP to
inject a bean in them.
> Or is it a better plan to extend the module to just handle it's own
> DB connections in a better manner.
That would be much cleaner, though you'll end up with two connection
pools to the same database.
> Conceptually if you're using MySQL for AuthN, the same connection would
> most likely also provide the attribute release, so pooling into a single
> point seems to make sense to me.
Yeah, makes sense to me too.
Etienne
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://shibboleth.net/pipermail/dev/attachments/20151207/e25a672e/attachment.sig>
More information about the dev
mailing list