I am a read-only user to an oracle database, and the DBA gave me two accounts, one with a specific user name and password, and another with OS authentication. The OS authentication is supposed to let me connect by authenticating with my active directory user account that I use to login to my laptop, where I am then running sqlplus.
I can connect and start querying just fine with this command, which shows it is picking up my tnsnames file:
sqlplus username/password@database
However, the version to connect with OS authentication doesn't work:
sqlplus /@database
ERROR: ORA-01017: invalid username/password; logon denied
Am I doing something obviously wrong? I checked in powershell that my user and domain name are the user and domain name that was set up for OS authentication for this database.
I did another test, this time using powershell to do the connection and again with my AD login that should work:
Add-Type -Path "C:\Windows\Microsoft.NET\Oracle.ManagedDataAccess\Oracle.ManagedDataAccess.dll"
#This connection string works for the normal authenticated account
$connectionString = "User Id=$username;Password=$password;Data Source=$datasource"
#But this one gives me ORA-01017 invalid username/password
$connectionString = "User Id=/;Data Source=$datasource"
$connection = New-Object Oracle.ManagedDataAccess.Client.OracleConnection($connectionString)
$connection.open()
I also made sure that SQLNET.AUTHENTICATION_SERVICES= (NTS) is in the sqlnet.ora file
Any thoughts?
1 Answer 1
For anything looking for an answer: I was connecting the correct way. On the backend, remote_os_authent was set to false, which would not allow this kind of authentication.
-
1
remote_os_authent=true
. So I guess cybersecurity and audits are of no concern at all at your organization.Balazs Papp– Balazs Papp2020年07月28日 20:26:12 +00:00Commented Jul 28, 2020 at 20:26 -
I agree: setting remote_os_authent=true is one of the worst possible security holes your system could have... i hope this is just for training purposes and not for anything real.pmdba– pmdba2020年07月28日 21:47:12 +00:00Commented Jul 28, 2020 at 21:47
Integrated Security=yes
as part of your connection stringsqlplus /@database
working with Kerberos authentication, you need to set some extra parameters in the clientsqlnet.ora
(enable Kerberos authentication, enable the use of Windows credential cache), which the DBA should be able to provide. First clarify that.