Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,11 @@ Response response = client

Supported schemes: **Basic**, **Digest**, **NTLM**, **SPNEGO/Kerberos**, **SCRAM-SHA-256**.

SPNEGO/Kerberos canonical-hostname resolution is disabled by default. Enabling it with
`setUseCanonicalHostname(true)` performs a blocking JVM lookup while generating the authentication token; during
an authentication retry, that work can run on a Netty event-loop thread. When the service principal name is known,
provide it with `setServicePrincipalName(...)` instead of enabling hostname canonicalization.

## Proxy Support

```java
Expand Down
8 changes: 8 additions & 0 deletions client/src/main/java/org/asynchttpclient/Realm.java
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,9 @@ public boolean isOmitQuery() {
return servicePrincipalName;
}

/**
* Returns whether SPNEGO/Kerberos authentication canonicalizes the target hostname through the JVM resolver.
*/
public boolean isUseCanonicalHostname() {
return useCanonicalHostname;
}
Expand Down Expand Up @@ -421,6 +424,11 @@ public Builder setServicePrincipalName(@Nullable String servicePrincipalName) {
return this;
}

/**
* Enables JVM canonical-hostname resolution when deriving the SPNEGO/Kerberos service principal name.
* Resolution is blocking and can run on a Netty event-loop thread during authentication retries. Prefer
* {@link #setServicePrincipalName(String)} when the service principal name is known.
*/
public Builder setUseCanonicalHostname(boolean useCanonicalHostname) {
this.useCanonicalHostname = useCanonicalHostname;
return this;
Expand Down
Loading