This is a migrated thread and some comments may be shown as answers.

Oracle Proxy User

9 Answers 169 Views
Databases and Data Types
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Paweł Zamrij
Top achievements
Rank 1
Paweł Zamrij asked on 19 Mar 2010, 02:10 PM

Hi,

Is it possible to connect with oracle db with 'proxy user id' and 'proxy password' options in connectionstring?
e.g.

<connections>   
  <connection id="DB">   
  <connectionString>Data Source=orcl;Persist Security Info=True;User ID=user;Proxy User ID=proxyUser;Proxy Password=proxypass;</connectionString>   
  <backendconfigurationname>oracleConfiguration</backendconfigurationname>   
  </connection>   
  </connections>  
 
 

 

 

 


My code:

 

Database db = Database.Get("DB");   
IObjectScope scope = db.GetObjectScope();  
 

 


returns exception:

 

 

 

 

System.ArgumentException: Keyword not supported: 'proxy user id'.
   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.DBDriver.connect(ConnectionString connectionString, IDictionary driverProps)
   at OpenAccessRuntime.Relational.conn.RelationalConnectionPool.createRealCon()
   at OpenAccessRuntime.Relational.conn.RelationalConnectionPool.init()
   at OpenAccessRuntime.Relational.RelationalStorageManagerFactory.connect()
   at OpenAccessRuntime.Relational.RelationalStorageManagerFactory..ctor(StorageManagerFactoryBuilder b)
   at OpenAccessRuntime.storagemanager.StorageManagerFactoryBuilder.createSmfForURL()

 

 

 

 

 

 

9 Answers, 1 is accepted

Sort by
0
Jordan
Telerik team
answered on 23 Mar 2010, 01:53 PM
Hello Paweł Zamrij,

Currently OpenAccess does not support these options.
What you could do is use TNS names. You can look at the following links for more information:
http://www.telerik.com/support/kb/orm/general/connecting-to-oracle-databases.aspx
http://www.telerik.com/help/openaccess-orm/configuration-file-format.html

All the best,
Jordan
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Sarulatha Selvan
Top achievements
Rank 1
answered on 10 Nov 2010, 02:17 PM
Hello Jordan,
Is there any update on this issue? Do you guys have any plan to provide this feature?
 
Appreciate your response.

Thanks!
Saru S
0
Jordan
Telerik team
answered on 11 Nov 2010, 05:05 PM
Hello Sarulatha Selvan,

Please, find the answer to your question in your ticket on the same subject.

Greetings,
Jordan
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Henk
Top achievements
Rank 1
answered on 03 Dec 2010, 03:40 PM
Hi,

I also want to use a proxy user because of security requirements of some of our clients. They want to audit the dml done by the web user.

I am also interested when ORM makes it available to log in as a proxy user.

Regards,

Henk
0
Ady
Telerik team
answered on 08 Dec 2010, 03:17 PM
Hello Henk,

This is possible if you use Oracle's .NET provider - ODP.NET, to connect to the database. With the latest Q3 version we always use the ODP provider and hence specifying the proxy user/password in the connection string will work.
With a previous version of OpenAccess you need to add the - driver="odp"  , attribute to the app.config file in order to use the ODP provider. You can do this manually or by using the 'Backend Configuration' wizard and setting the 'Database driver' property.

The entry is as follows
<backendconfigurations>
      <backendconfiguration id="oracleConfiguration" backend="oracle" driver="odp">
        <mappingname>oracleMapping</mappingname>

  Hope this helps.

Kind regards,
Ady
the Telerik team
Accelerate your learning with industry's first Telerik OpenAccess ORM SDK. Download today.
0
Henk
Top achievements
Rank 1
answered on 10 Dec 2010, 03:32 PM
Hello,

I am already using the new OA structure.
But if I specify both users in the web.config the user id's are fixed and the same user-id is used for all web application users.
In my web application I want to build a authentication mechanism
How is it possible in a n-tier situation to specify the user-id so the database knows which user is using the web application.
If I specify the Oracle proxy user in the web.config this DB user can maintain the connections (pool)
In my code (not in the config) I want to specify the real user id so the database knows which user is using the web application (for audit).
Do you have an example how to achieve this?

Kind Regards.
0
Ady
Telerik team
answered on 16 Dec 2010, 12:38 PM
Hi Henk,

You could manage the connection string at runtime to reflect the currently connected web application user. The proxy user and password would remain the same and you can add the user id/password to the connection string. Then use this connection string to instantiate the OpenAccess context. You should specify the entire connection string and not only the connection string name. This would ensure that the OpenAccess runtime connects as the current web app user. 

Also make sure that for a web app user - A, the connection string used to instantiate the context is the same everytime so that the same underlying cached OpenAccess Database instance is used.

Regards,
Ady
the Telerik team
Accelerate your learning with industry's first Telerik OpenAccess ORM SDK. Download today.
0
Henk
Top achievements
Rank 1
answered on 04 Jan 2011, 03:33 PM
Hi,

I want to use this in a WCF RIA scenario (OpenAccessDomainService)
Can you give me an example where to implement this? Where can I provide a custom connection string when the context is instantiated.
I want to use the username in the connectionstring from the username of the authenticated user of the WCF RIA Service.

Kind Regards.
0
Jan Blessenohl
Telerik team
answered on 10 Jan 2011, 03:56 PM
Hi Henk,
The OpenAccess Ria Provider calls the default ctor of the class that is specified in the tt file. Because the generated context has a generated default ctor, you cannot really change it without bigger effort. What you can do is, derive a new class from the generated context class, implement what you want in the ctor. You can add a static function that calculates the connection string:

namespace SilverlightApplication2.Web
{
    public partial class NorthwindEntityDiagramsSpecial : NorthwindEntityDiagrams
    {
        public NorthwindEntityDiagramsSpecial() : base(GetConnectionString())
        {
        }
  
        private static string GetConnectionString()
        {
            // create new connection string with impersonation information
            throw new NotImplementedException();
        }
    }
}


Greetings,
Jan Blessenohl
the Telerik team
Accelerate your learning with industry's first Telerik OpenAccess ORM SDK. Download today.
Tags
Databases and Data Types
Asked by
Paweł Zamrij
Top achievements
Rank 1
Answers by
Jordan
Telerik team
Sarulatha Selvan
Top achievements
Rank 1
Henk
Top achievements
Rank 1
Ady
Telerik team
Jan Blessenohl
Telerik team
Share this question
or