Skip to content

Commit 586a832

Browse files
Fix proxy SPNego authentication to respect krb5.conf canonicalization settings. (#541)
This PR changes `SPNegoSchemeFactory` constructor in `ProxyUtils.java` to use `useCanonicalHostname=false`, deferring hostname canonicalization to the Kerberos library based on `krb5.conf` configuration instead of forcing it at the SDK level. The previous implementation forced hostname canonicalization for proxy Kerberos authentication, overriding user-configured `krb5.`conf settings (rdns, dns_canonicalize_hostname). This caused authentication failures in environments with specific Kerberos configurations. Client libraries should respect system Kerberos configuration rather than override it. This fix makes the SDK compliant with standard Kerberos behavior. **Migration note:** Users whose non-compliant Kerberos setups were accidentally working due to forced canonicalization may need to verify their `krb5.conf` settings are correctly configured.
1 parent 33d8df7 commit 586a832

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

NEXT_CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
### Bug Fixes
88

9+
* Fix proxy SPNego authentication to respect krb5.conf canonicalization settings instead of forcing hostname canonicalization. The SDK now defers to the Kerberos library configuration for hostname resolution. **Migration note**: If you experience new Kerberos authentication failures with proxy servers after upgrading, verify that your `krb5.conf` canonicalization settings (`rdns` and `dns_canonicalize_hostname`) are correctly configured for your environment.
10+
911
### Security Vulnerabilities
1012

1113
### Documentation

databricks-sdk-java/src/main/java/com/databricks/sdk/core/utils/ProxyUtils.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,10 @@ public Principal getUserPrincipal() {
128128
.setDefaultCredentialsProvider(credsProvider)
129129
.setDefaultAuthSchemeRegistry(
130130
RegistryBuilder.<AuthSchemeProvider>create()
131-
.register(AuthSchemes.SPNEGO, new SPNegoSchemeFactory(true))
131+
// Use SPNegoSchemeFactory with useCanonicalHostname=false to defer hostname
132+
// canonicalization to the Kerberos library based on krb5.conf settings
133+
// (rdns, dns_canonicalize_hostname) rather than forcing canonicalization.
134+
.register(AuthSchemes.SPNEGO, new SPNegoSchemeFactory(true, false))
132135
.build());
133136
}
134137

0 commit comments

Comments
 (0)