ODP.NET and Proxy User Id
695642Jun 25 2010 — edited Jun 29 2010Hello,
I have an ASP.NET application that tries to connect to an Oracle 10G R2 database using ODP.NET 11 drivers.
We have a specific requirement to use EUS Proxy Authentication here is my connection string:
<add name="OracleDatabase" connectionString="Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=SERVER)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORACLEDB)));User Id=myuser;Proxy User Id=proxuser; Proxy Password=proxpwd;Min Pool Size=0;Connection Timeout=30;" />
When I execute my code there is an Error that comes back:
ORA-28150: proxy not authorized to connect as client
Through SQLPlus I can connect via the EUS Proxy Authentication successfully.
I have also tried to use Database Proxy (i.e. both users were db users) and I get the same error.
It always fails on Open of the connection.
For reference here is my snippet of code:
using Oracle.DataAccess.Client;
public partial class Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
String myConnectionString = ConfigurationManager.ConnectionStrings["OracleDatabase"].ConnectionString;
if (!(Page.IsPostBack))
{
using (OracleConnection myConnection = new OracleConnection(myConnectionString))
{
try
{
myConnection.Open();
if ((myConnection.State & ConnectionState.Open) > 0)
{
OracleCommand myCMD = new OracleCommand();
myCMD.Connection = myConnection;
myCMD.CommandText = String.Format("select ... ");
OracleDataReader reader = myCMD.ExecuteReader(CommandBehavior.CloseConnection);
while (reader.Read())
{
...
}
reader.Dispose();
myCMD.Dispose();
}
}
catch (OracleException ex)
{
MessageBox("Oracle Exception: " + ex.Message);
}
finally
{
myConnection.Close();
}
}
}
}