Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Connecting through proxy and expired password

13943Jan 4 2006 — edited Jan 10 2006
Hi all,

I have a problem connecting a user with an expired password through a proxy user. My connection string is for example:

User ID=SCOTT;Password=TIGER;Proxy User ID=HR;Proxy Password=HR;Data Source=mydb

If SCOTT's password is expired, the connection opens without the ORA-28001 as I would expect. If I don't use proxy authentication (just a normal connection), the exception is thrown.

Is there some reason for this that I am missing? Below is a sample console app. I am using ODP.NET version 10.2.0.100

Thanks for any feedback.

-- Tom


using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

using Oracle.DataAccess.Client;

namespace TestConsole {

class Program {

static void Main(string[] args) {

/* Assumptions for this demo:
* Data Source = "mydb"
* SCOTT's password has expired
* HR's password is HR
* SCOTT may connect via proxy through HR:
* ALTER USER SCOTT GRANT CONNECT THROUGH HR AUTHENTICATED USING PASSWORD
*/

string connStringNormal = "User ID=SCOTT;Password=TIGER;Data Source=mydb";
string connStringProxy = "User ID=SCOTT;Password=TIGER;Proxy User ID=HR;Proxy Password=HR;Data Source=mydb";

string[] connStrings = new string[]{connStringNormal, connStringProxy};

foreach (string cs in connStrings) {
Console.WriteLine("Attempting with connection string: " + cs);
OracleConnection conn = new OracleConnection(cs);

try {
conn.Open();
Console.WriteLine("Connection opened OK.");
}
catch (OracleException ex) {
Console.WriteLine(ex.Message);
}
finally {
if (conn != null && conn.State == ConnectionState.Open) {
conn.Close();
}
}
}

Console.ReadLine();
}
}
}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 7 2006
Added on Jan 4 2006
1 comment
841 views