Oracle - Connecting as a proxy user via connection string I have been granted access to a specific schema in an Orale database via a "proxy user" / "connect through" .

In SQL Developer / TOAD, I give my username as "MyUser[SomeSchema]", and after login I am now able to query all tables etc. in SomeSchema. I can also login using just "MyUser", but then I am not able to query any tables in SomeSchema (not even if using the schema.table syntax.)

So my question is: How do I "replicate" the MyUser[SomeSchema] approach when connection from code using a connection string (using ODP.NET on .NET)?

UPDATE 1
I found that if I run the following SQL in Toad, I actually get the result I want.

connect MyUser[SomeSchema]/{password for MyUser};


My current schema is changed to SomeSchema and I can query it's tables.

Question is, whether this can be achieved via ODP.NET directly?

UPDATE 2
I finally figured out how to piece together the connection string. See my own answer below.



Research

I've googled quite a bit, and tried the following with no luck.


Supplying MyUser[SomeSchema] as "User Id".
Supplying the "Proxy User Id" and "Proxy Password" parameters in the connection string. However, I do not have a proxy user password.
Changing the schema after login using the "ALTER SESSION" syntax: "ALTER SESSION SET CURRENT_SCHEMA = SomeSchema". This does not fail, but I am still not able to query any tables in the schema.
Using SQL Tracker on Toad itself, to see if it ran any SQL to connect to the proxy, but that seems to happen "before" SQL Tracker can pick anything up. Triggers?
I finally found out how to represent the proxy user login via my connection string.


Proxy User ID = MyUser
Proxy Password = MyUser password
User Id = SchemaName
User Password not set.


The dime finally dropped  after visiting https://www.devart.com/dotconnect/oracle/docs/ProxyUserConnection.html and running the SQL query below, after having logged in via Toad. Here it was clear to me, that I had misunderstood, that MyUser was in fact the proxy user...

SELECT SYS_CONTEXT('USERENV', 'PROXY_USER'), SYS_CONTEXT('USERENV', 'SESSION_USER') FROM dual