Trouble connecting to Oracle database with sqlplus and OS authentication

oraclepowershell

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?

Best Answer

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.