Skip to main content

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 (or, since v0.4.4, in the error details: see Troubleshooting → Error codes), so a connection pool does not retry it as a network fault (it was IO before).

Minimum verifier (allowed_logon_version)​

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:

ValueAcceptsNotes
11 (default)11G and 12C verifiersSame as the Oracle 19c client default, so accounts that only have an 11G verifier keep working.
1212C verifier onlyAn 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:

ModeEncryptsAuthenticates the server
disable (default)no—
requireyesno (chain only, if a CA is given)
verify-cayeschain only
verify-fullyeschain 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 whenever the server supports it (the driver sets no maximum version). The minimum is fixed: there is no option to allow TLS 1.0 / 1.1.

Since v0.4.5 the released binaries offer the hybrid post-quantum key exchange X25519MLKEM768 first in TLS 1.3 and fall back to what the server supports. The read-only connection options adbc.arpeoracle.tls.version, tls.group and tls.cipher report what a connection's handshake negotiated, and ARPEIO_ADBC_LOG_TLS=1 prints it on standard error: see Connection → Driver information.

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.5.9, a long-term support series, on Linux and Windows since v0.4.5, and with OpenSSL 3.6.5 before; 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:

  1. ssl_root_cert (a PEM file);
  2. the wallet's ewallet.pem;
  3. 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.pem and /etc/ssl/cert.pem, so RHEL / Rocky / AlmaLinux and Debian / Ubuntu both work. When SSL_CERT_FILE or SSL_CERT_DIR is set, that is used instead.
    • Windows: the certificates of the system ROOT store.

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. A certificate whose subject holds a NUL byte in an attribute value matches no expected DN.

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.

Kerberos (KERBEROS5)​

Version

In the released Linux binary since ArpeOracle v0.4.4. Not available on Windows.

External authentication with a Kerberos ticket, with no Oracle password. Set Auth Method=kerberos (option adbc.arpeoracle.auth_method). The identity is proven with the ticket while the connection is negotiated, with mutual authentication, and the O5LOGON password phase is skipped. Kerberos uses MIT Kerberos and is available on Linux only.

  • Linux: the driver loads the MIT Kerberos client library (libkrb5.so.3) at the first Kerberos login rather than linking it, so the driver still loads on a host without Kerberos, and password and token logins never need it. Install the library on the host to use Kerberos: krb5-libs (RHEL, Rocky, Fedora) or libkrb5-3 (Debian, Ubuntu). Without it a Kerberos login fails with "Kerberos (KERBEROS5) authentication needs the MIT Kerberos client library libkrb5.so.3, which could not be loaded". The environment variable ARPEORACLE_KRB5_LIBRARY names another library to load instead (a soname or a full path, for a Kerberos installed outside the loader's search path).
  • Windows: not available. auth_method=kerberos fails at connect there. Every other authentication method works on Windows.

Up to v0.4.3 the released Linux binary had no Kerberos either, and auth_method=kerberos failed at connect.

Kerberos Cred Mode (krb5_cred_mode) chooses how the ticket is obtained:

  • ccache (default): the ambient kinit ticket (KRB5CCNAME, or a per-connection cache via Kerberos Cache / krb5_ccache). Any valid ticket will do; it only needs to be forwardable (kinit -f) with Kerberos Forward=true.
  • keytab: a keytab file (Kerberos Keytab / krb5_keytab) plus Kerberos Principal; for service accounts and scheduled jobs.
  • password: Kerberos Principal + Kerberos Password, obtained through the Kerberos library into a private in-memory cache (never written to disk).

Kerberos SPN (krb5_spn) overrides the target service principal, which otherwise defaults to oracle/<host>; Kerberos Realm (krb5_realm) supplies the default realm when the principal carries none.

Kerberos Forward (krb5_forward, default false) controls credential delegation. Off, the driver sends the database no credential beyond the service ticket, and the keytab / password modes ask for a non-forwardable ticket. Set it to true only when the database must act as the user onward (a database link or another service authenticated with the user's Kerberos identity): the driver then forwards the user's ticket-granting ticket to the server, which hands whoever controls the database host the user's identity across the realm for the life of the ticket. With ccache mode the ticket must then be forwardable (kinit -f); the keytab / password modes request a forwardable one.

Server=dbhost:1521/orclpdb1;Auth Method=kerberos;Kerberos Cred Mode=ccache;
Kerberos SPN=oracle/dbhost.example.com

No username or password is needed: the database user is mapped from the Kerberos principal (CREATE USER … IDENTIFIED EXTERNALLY AS '<principal>'). Kerberos composes with Native Network Encryption: add Encryption=required (and/or Data Integrity=required) to authenticate with a ticket over an AES-256 / SHA-256 channel.

Kerberos errors are listed under Troubleshooting → Authentication.

OCI IAM token (Oracle Cloud)​

Version

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 the ADBC option adbc.arpeoracle.token_location, and since v0.4.3 also the Token Location connection-string keyword and the token_location URI parameter (a discrete option only before). 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 (or verify-ca) 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.

Verify the server certificate. ssl_mode=require with no CA configured (neither ssl_root_cert nor wallet_location) is accepted, but it encrypts without checking who is at the other end: an active man in the middle can present its own certificate, read the token and relay the signed logon to the real server, logging in as you. Use verify-full, or verify-ca when the host name cannot match the certificate. Keep require for test servers with a self-signed certificate.

Server=adb.<region>.oraclecloud.com:1522/<svc>_low.adb.oraclecloud.com;
Auth Method=token;sslmode=verify-full;Wallet Location=/home/you/wallet;Wallet Password=...;
Token Location=/home/you/.oci/db-token

Up to v0.4.2, set adbc.arpeoracle.token_location=/home/you/.oci/db-token as an ADBC option alongside the connection string instead.

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​

Version

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. Since v0.4.3 they are also the Access Token / Token File connection-string keywords and the access_token / token_file URI parameters; up to v0.4.2 they were ADBC options only, set via AdbcDatabaseSetOption (or the equivalent in the language binding).

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.

Verify the server certificate. As with the OCI IAM token, ssl_mode=require with no CA configured is accepted but does not verify the server certificate. Against an active man in the middle that is no better than plain TCP for a bearer token: the attacker reads the JWT and can replay it until it expires, from anywhere the token is accepted. Use ssl_mode=verify-full (or verify-ca) whenever a bearer token is sent.

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, or Token File=<path> added to the string — 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. This does not affect Kerberos ticket authentication on Linux (above). On Windows, use one of the other methods (password, proxy, TLS, OCI IAM token, OAuth2/Entra), all available on both Linux and Windows.