[jboss-user] [Security & JAAS/JBoss] - Obtaining Principal from within custom Oracle JDBC driver

abickford4523 do-not-reply at jboss.com
Sun May 10 17:35:56 EDT 2009


Hello,

I've created my own custom login module which extends AbstractServerLoginModule. I've also created a custom JDBC Driver which extends java.sql.Driver. My custom JDBC driver is necessary as I'm attempting to get JBoss working with a technology called Oracle Proxy Authentication. Essentially, the JDBC connection pool is setup to authenticate using a common user called 'proxy_user'. The JDBC driver needs to obtain the username that the user logged in with which it can then use to proxy over to that account calling OracleConnection.openProxySession(username). From then on, for that connection, queries executed against the database appear to run as the authenticated user, not 'proxy_user'.

I feel very confident that my custom login module works correctly as I'm able to login to a test JSF application and print out various Principals from the Subject obtained like this in my backing bean:


  | Subject caller = (Subject) PolicyContext.getContext("javax.security.auth.Subject.container");
  | 

Unfortunately, attempting to do that same Subject lookup from my JDBC driver always returns null. Is there a better/different way I should be obtaining the Principals from within the JDBC driver?

I am loosely following this wiki article: http://www.jboss.org/community/docs/DOC-10049

Thanks,
Andre

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4229908#4229908

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4229908



More information about the jboss-user mailing list