ArpeOracle authentication
How ArpeOracle authenticates to Oracle, method by method. Every option named here is listed in the Connection option reference.
Password (O5LOGON)
The default. Supply User ID and Password; ArpeOracle performs Oracle's
O5LOGON challenge-response. The 12c (PBKDF2-HMAC-SHA512) and 11g (SHA-1)
verifiers are both supported and selected automatically from the server's
challenge.
Server=dbhost:1521/orclpdb1;User ID=scott;Password=tiger
The password is never sent in clear, even without TLS: it is AES-encrypted under a key derived from the server's challenge, and the driver verifies the server's response in return (mutual auth), so a man-in-the-middle that accepts any password is detected. This protects the credential — it does not encrypt SQL text or result rows. For that, use TLS or Native Network Encryption; only TLS also stops an active man-in-the-middle, NNE resists passive eavesdropping only.
A wrong username or password fails fast with ORA-01017. Oracle does not
distinguish "no such user" from "wrong password", and neither does the error.
Since v0.4.1 a refused logon (ORA-01017, ORA-28000 account locked, ORA-28001
password expired, ORA-01005, ORA-01045) is reported as UNAUTHENTICATED with
the ORA number as vendor_code, so a connection pool does not retry it as a
network fault (it was IO before).
Minimum verifier (allowed_logon_version)
Since ArpeOracle v0.4.1.
The client sends its encrypted session key and password before it can check
the server's mutual-auth response, so on a connection without TLS a
man-in-the-middle can answer the challenge with the weak 11G (SHA-1) verifier
and test password guesses offline against what the client sends back. Native
Network Encryption does not prevent this (its key exchange is not
authenticated). adbc.arpeoracle.allowed_logon_version (keyword
Allowed Logon Version), modelled on Oracle's
SQLNET.ALLOWED_LOGON_VERSION_CLIENT, sets the floor:
| Value | Accepts | Notes |
|---|---|---|
11 (default) | 11G and 12C verifiers | Same as the Oracle 19c client default, so accounts that only have an 11G verifier keep working. |
12 | 12C verifier only | An 11G challenge, or a 12C one asking for fewer than 4,096 PBKDF2 iterations (Oracle always uses 4,096), is refused before anything derived from the password is sent. 12a is accepted as a synonym. |
Server=dbhost:1521/orclpdb1;User ID=scott;Password=tiger;Allowed Logon Version=12
With 12, a refused login reports that the server offered the 11G verifier:
either the account has only an 11G verifier (check PASSWORD_VERSIONS in
DBA_USERS; resetting the password on a server with
SQLNET.ALLOWED_LOGON_VERSION_SERVER=12 or higher creates the 12C one), or a
man-in-the-middle downgraded the login. TLS (ssl_mode=verify-full) protects
against the downgrade whatever this option says.
Whatever the setting, the PBKDF2 iteration counts the server sends must be between 1 and 1,000,000; a count outside that range is refused with "server sent an out-of-range ..." before any key derivation runs.
Proxy authentication (connect through)
Authenticate as one account but run in another user's schema. The authenticating account must have been granted access:
ALTER USER target GRANT CONNECT THROUGH proxyacct;
Server=dbhost:1521/orclpdb1;User ID=proxyacct;Password=...;Proxy User=target
Inside the session, SYS_CONTEXT('USERENV','SESSION_USER') is TARGET and
PROXY_USER is PROXYACCT. An ungranted target, or a wrong password for the
authenticating account, is refused with ORA-01017.
Change password at connect
Change the login password as part of the connect — the way in past an expired one. The old password authenticates the request; the new one takes effect on success.
Server=dbhost:1521/orclpdb1;User ID=scott;Password=old;New Password=new
After a successful connect the new password authenticates and the old one no longer does.
TLS (TCPS)
Encrypts the whole connection. SSL Mode selects the level:
| Mode | Encrypts | Authenticates the server |
|---|---|---|
disable (default) | no | — |
require | yes | no (chain only, if a CA is given) |
verify-ca | yes | chain only |
verify-full | yes | chain and hostname (or ssl_server_cert_dn) |
Use verify-full for anything real. A PROTOCOL=TCPS descriptor or
tnsnames.ora entry defaults to verify-full (since v0.4.1). Trust comes
from SSL Root Cert (a PEM CA bundle) or a Wallet Location directory holding
ewallet.pem (client key + certificate + CAs in one PEM, the python-oracledb
thin layout); Wallet Password unlocks an encrypted wallet key. Without either,
the operating system's CA store is used (see
below). require with SSL Root Cert
or Wallet Location still verifies the chain against that CA (since v0.4.1).
A wallet or CA bundle does not enable TLS on its own — combined with
disable it is rejected. TLS 1.2 is the minimum. TCPS listeners conventionally
use port 2484 — set Port explicitly.
Server=dbhost:2484/orclpdb1;User ID=scott;Password=tiger;
sslmode=verify-full;wallet_location=/etc/oracle/wallet
Protocol versions
TLS 1.2 is the minimum and TLS 1.3 is used when the server offers it. The minimum is fixed: there is no option to allow TLS 1.0 / 1.1.
Independent of the host's TLS stack
Because the driver brings its own OpenSSL, the TLS versions it can use do not depend on the host. A server that only accepts TLS 1.3 works even where the host's own TLS stack has no TLS 1.3: for example Windows Server 2019 and older (Schannel), or a Linux host whose system OpenSSL is 1.0.x. The limit on Linux is the C library: the released binary needs glibc 2.28 or later (RHEL 8, Debian 10, Ubuntu 20.04 or newer), so RHEL 7 is not supported.
Where trusted certificates come from
ArpeOracle carries its own copy of OpenSSL 3, linked into the library (the
release binaries are built with OpenSSL 3.6.5 on Linux and Windows; the
read-only option adbc.arpeoracle.openssl_version reports it, see
Connection → Driver information).
It never uses the operating system's TLS stack. For verify-ca /
verify-full, the CAs come from, in this order:
ssl_root_cert(a PEM file);- the wallet's
ewallet.pem; - the operating system's CA store (since v0.3.12), added to OpenSSL's
default locations:
- Linux: the first readable bundle among
/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem,/etc/pki/tls/certs/ca-bundle.crt,/etc/ssl/certs/ca-certificates.crt,/etc/ssl/ca-bundle.pemand/etc/ssl/cert.pem, so RHEL / Rocky / AlmaLinux and Debian / Ubuntu both work. WhenSSL_CERT_FILEorSSL_CERT_DIRis set, that is used instead. - Windows: the certificates of the system
ROOTstore.
- Linux: the first readable bundle among
ssl_root_cert and a wallet replace the system trust entirely. Before v0.3.12
only OpenSSL's default locations were read, which on RHEL 8 and Windows hold
no CAs. Oracle Cloud ADB connections are not affected: the instance wallet
carries the CAs.
Host name check and SNI
With verify-full (and no ssl_server_cert_dn):
- A DNS name must be in the certificate's DNS SANs, or its CN when it has none.
A wildcard must be the whole first label (
*.example.com). The name is also sent as SNI. - An IP address (
10.0.0.5,::1, or[::1]in a URI) must be in the certificate's iPAddress SANs (IP:10.0.0.5); a DNS SAN or CN spelling the address does not count. No SNI is sent for it. Since v0.4.1; before that a server reached by IP address always failed the check. - After a listener REDIRECT (SCAN/RAC), the certificate of the server redirected to may be issued for the redirect host or the host you configured, as JDBC thin checks (since v0.4.1). The REDIRECT itself arrived over the first TLS session, already verified against the configured host.
Oracle's DN matching is supported (since v0.4.1): with ssl_server_cert_dn
(or SSL_SERVER_CERT_DN in a descriptor's SECURITY section), verify-full
checks the certificate subject against that DN instead of the hostname. Every
attribute must match, in any order, case-insensitively.
Client certificates (mutual TLS)
A wallet's certificate and key are always presented to the server, in every
ssl_mode including require. There is no separate client certificate or key
option; wallet_password unlocks an encrypted key.
TCPS from a descriptor or tnsnames.ora
PROTOCOL=TCPS in a connect descriptor or alias turns TLS on as verify-full
(since v0.4.1): the chain is checked against ssl_root_cert /
wallet_location, else the operating system's CA store, and the hostname is
checked. In the descriptor's SECURITY section, SSL_SERVER_DN_MATCH=no means
verify-ca (chain only) and SSL_SERVER_CERT_DN replaces the hostname check
with a match of the certificate subject; wallet settings there are ignored (use
wallet_location). An explicit ssl_mode always wins, so a server with a
self-signed certificate is reached with its CA or with ssl_mode=require. Up to
v0.4.0 a TCPS descriptor implied require and never checked the certificate.
OpenSSL configuration
Like any OpenSSL 3 program, the driver reads an OpenSSL configuration file at
the first TLS connection: the file named by OPENSSL_CONF, else
/etc/ssl/openssl.cnf on Linux. Settings there, such as cipher lists or the
security level, apply. RHEL's system crypto-policies live under
/etc/pki/tls/openssl.cnf, so they apply only if that file is the one loaded
(for example with OPENSSL_CONF=/etc/pki/tls/openssl.cnf). sqlnet.ora is
never read.
TLS errors are listed under Troubleshooting → TLS / wallets.
OCI IAM token (Oracle Cloud)
Since ArpeOracle v0.2.0.
Auth Method=token logs in to Oracle Cloud with an OCI IAM database token
instead of a password. token_location is a directory holding the token
(token) and its PEM private key (oci_db_key.pem) — exactly what
oci iam db-token get writes to ~/.oci/db-token. It is an ADBC option
(adbc.arpeoracle.token_location), set via AdbcDatabaseSetOption, not a
connection-string keyword. No username or password is
set: the driver presents the token and proves it holds the matching private key
by signing the login request with it (RSA-SHA256). The database validates the
signature against the public key inside the token, so a token used with the
wrong key is refused with an ORA error.
TLS is required (since v0.4.1). The token crosses the wire, so the driver
refuses this method on a plain TCP connection, at AdbcDatabaseInit and again
before the token is sent, with auth_method=token requires a TLS (TCPS) connection. Set ssl_mode (verify-full for anything real) or connect through
a TCPS descriptor / tnsnames.ora entry, which brings verify-full on its own.
Up to v0.4.0 the token was sent over plain TCP when ssl_mode was left at
disable.
Server=adb.<region>.oraclecloud.com:1522/<svc>_low.adb.oraclecloud.com;
Auth Method=token;sslmode=verify-full;Wallet Location=/home/you/wallet;Wallet Password=...
with adbc.arpeoracle.token_location=/home/you/.oci/db-token set as an ADBC
option alongside it (the same way the OAuth2 token options below are set).
The database must have IAM authentication enabled
(DBMS_CLOUD_ADMIN.ENABLE_EXTERNAL_AUTHENTICATION(type => 'OCI_IAM')) and the
OCI identity mapped to a schema (CREATE USER … IDENTIFIED GLOBALLY AS 'IAM_PRINCIPAL_NAME=<user>'). ADB requires mutual TLS, so pair it with the
instance wallet. Tokens expire (~1 h); re-mint with oci iam db-token get.
OAuth2 / Microsoft Entra ID bearer token
Since ArpeOracle v0.2.2.
External authentication with a Microsoft Entra ID (Azure AD) access token —
no Oracle password, no OCI private key. Set adbc.arpeoracle.access_token to
the bearer JWT inline, or adbc.arpeoracle.token_file to a path holding just
the JWT; if both are set, the inline access_token wins. These are ADBC
options, not connection-string keywords — set them via AdbcDatabaseSetOption
(or the equivalent in the language binding), not inside the Server=...;...
string.
Setting either option auto-selects the method, so Auth Method does not
need to be set explicitly; Auth Method=oauth2 (adbc.arpeoracle.auth_method)
also works and is required if you want the driver to fail fast when neither
token option ends up set. An explicit Auth Method naming anything other than
oauth2 alongside access_token/token_file is rejected as a configuration
conflict rather than silently overridden.
No username is configured: Oracle derives the global user from the token's
upn claim.
Unlike the OCI IAM token above, a bearer token
carries no private key, so there is no signature step: presenting the token is
the whole login. Treat the token (and any token_file) as a secret.
TLS is required (since v0.4.1), as for the OCI IAM token: a bearer token
sniffed off a plain TCP connection could be replayed until it expires, so
without ssl_mode (or a TCPS descriptor) the driver fails with
auth_method=oauth2 requires a TLS (TCPS) connection and never sends the token.
Server=adb.<region>.oraclecloud.com:1522/<svc>_low.adb.oraclecloud.com;
sslmode=verify-full;Wallet Location=/home/you/wallet;Wallet Password=...
(with adbc.arpeoracle.access_token or adbc.arpeoracle.token_file set
separately as an ADBC option — see above).
Autonomous Database setup: the Application ID URI
On Autonomous Database, the Entra app registration's Application ID URI
must be a domain-qualified https:// URI — e.g.
https://<tenant>.onmicrosoft.com/<appId> — not Azure's default
api://<appId>. The application_id_uri passed to
DBMS_CLOUD_ADMIN.ENABLE_EXTERNAL_AUTHENTICATION must match it exactly. A
non-https Application ID URI makes the ADB reject otherwise-valid tokens
with a generic ORA-01017 — Oracle does not surface the real reason, so a
misconfigured URI is easy to mistake for a bad token or a blocked account.
Connecting with an Entra token maps to an Autonomous Database global user
(AUTHENTICATION_METHOD = TOKEN_GLOBAL) — a user created
IDENTIFIED GLOBALLY AS 'AZURE_USER=<upn>'.
Not supported
- NTS/NTLM and Windows integrated authentication (SSPI), on any platform. Use one of the methods above (password, proxy, TLS, OCI IAM token, OAuth2/Entra), all available on both Linux and Windows.