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
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.
Is there any update on this issue? Do you guys have any plan to provide this feature?
Appreciate your response.
Thanks!
Saru S
Please, find the answer to your question in your ticket on the same subject.
Greetings,
Jordan
the Telerik team
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
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
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.
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
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.
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