Proxy Connections and PL/SQL

  • From: "MacGregor, Ian A." <ian@xxxxxxxxxxxxxxxxx>
  • To: <oracle-l@xxxxxxxxxxxxx>
  • Date: Tue, 17 Apr 2007 14:15:35 -0700

Proxy connections in effect allow a user to become another. One needs to grant 
a privilege 

ALTER USER <user to be proxied>   GRANT CONNECT THROUGH <PROXY_USER>.  Then run 
the statement:
 
 CONNECT <PROXY_USER>[<user to be proxied>]/<poxy_user's password>


This works great in SQL*Plus and there are java examples

private void proxyConnection() throws Exception {
        Properties properties = new Properties();
        properties.put("PROXY_USER_NAME", "pu_user_1");

        OracleConnection conn = (OracleConnection) DriverManager.getConnection(
                
"jdbc:oracle:thin:pu_pool_user/pu_pool_user@localhost:1521:ora1012",
                properties);
        conn.openProxySession(OracleConnection.PROXYTYPE_USER_NAME, properties);

        printUserInfo(conn);
        conn.close();
    }

What I want to do is to have log someone on as proxy_user and then proxy them.  
This is what the program above does.  I want to be able to do it in pl/sql.  I 
thought also of having pl/sql call a java stored procedure.  However in the 
example the proxy connection is dependent on a normal jdbc connection.

In detail the user would be connected via a Database Access descriptor, then a 
screen would pop up asking them to authenticate against Active Directory, and 
if successful the connection would be proxied.  Has anyone been successful 
doing this.

Ian MacGregor
Stanford Linear Accelerator Center
--
//www.freelists.org/webpage/oracle-l


Other related posts:

  • » Proxy Connections and PL/SQL