views:

117

answers:

1

I'm trying to access an oracle database using

using System.Data.OracleClient;

from a console application, accessing the database is fine. however from an ASP.NET web site i get the error:

ORA-12640: Authentication adapter initialization failed

I've googled around and found that changing sqlnet.ora file would solve the issue

//before
SQLNET.AUTHENTICATION_SERVICES= (NTS)
//after
SQLNET.AUTHENTICATION_SERVICES= (NONE)

Later I found another application on the same server, that uses other database of Oracle as well, is requiring the value of SQLNET.AUTHENTICATION_SERVICES to be "NTS". This would cause my web site to fail accessing the database with the error ORA-12640. I have tried "ALL" as value but still it didn't work.

How can I configure my website to access the oracle database while sqlnet.ora is configured as "SQLNET.AUTHENTICATION_SERVICES= (NTS)" ?

P.S. the website uses Windows Authentication and impersonate as follow:

<authentication mode="Windows"/>
<identity impersonate="true"/>
+3  A: 

This looks like the multi-hop impersonation issue to me.

If it's an option for you, I suggest having your application run under a single identity when accessing the database (this should also allow connection pooling to occur as a beneficial side-effect).

To do this, you would need to configure an app pool to run under an account that has access to Oracle. Once the application is running under that app pool, turn impersonation off in your application so that the database calls occur using the app pool identity.

If you have to impersonate the calling users over the network, the method used will depend on your environment. For more information, see How to Use Impersonation and Delegation in ASP.NET 2.0.

Dave Cluderay
Thanks, I think impersonate is not necessary for the website. I have disabled the impersonation after configuring a new app pool as you suggested, but i wasn't sure how to "make the pool run under an account that has access to oracle". I have used the local administrator of windows to authenticate the pool. I still have the same error.Is there a way to debug/log the username that is trying to access Oracle from an ASP.NET website?
ala
Hi - You should set the identity of the app pool to be a domain account (rather than a local account). The domain account you choose must have permission to access the database (see http://www.oracle.com/technology/pub/articles/mastering_dotnet_oracle/cook_masteringdotnet.html for some information). Perhaps try it with the app pool running under your own login initially, since you know you have access to the database.
Dave Cluderay
I've tried changing the pool authentication to run as "psmea\administrator" where "psmea" is the domain name. This user is what i use to login to the database server. but it is still the same error. do you know by any chance if I can trace/log/debug the errors of Oracle? maybe I can see the username that is causing the error in the website, and compare it to the username when successful login from the console application. Or am I looking at the wrong direction?
ala
I googled "troubleshoot windows oracle authentication" and this came back: http://download.oracle.com/docs/cd/B14099_19/idmanage.1012/b14085/trouble_int005.htm#BABEGJFH
Dave Cluderay