Class KerberosConfig
java.lang.Object
com.norconex.crawler.web.fetch.impl.httpclient.KerberosConfig
Configuration for Kerberos and SPNEGO authentication. When
using either HttpAuthMethod.SPNEGO or
HttpAuthMethod.KERBEROS, this configuration provides
the necessary Kerberos settings.
Typical usage
At a minimum, you need a valid Kerberos configuration file
(krb5.conf) and either a keytab file or access to
the system ticket cache. Set the servicePrincipalName
to the SPN of the target service (e.g.,
HTTP/server.example.com).
- Since:
- 4.0.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanPath to a keytab file containing the principal's key.Path to the Kerberos configuration file (krb5.conf).The JAAS login module name.The Kerberos principal name used for login (e.g.,user@REALM).The Kerberos service principal name (SPN) for the target service.inthashCode()booleanWhether to use the system ticket cache for authentication.setKeytabPath(Path keytabPath) Path to a keytab file containing the principal's key.setKrb5ConfigPath(Path krb5ConfigPath) Path to the Kerberos configuration file (krb5.conf).setLoginModuleName(String loginModuleName) The JAAS login module name.setPrincipal(String principal) The Kerberos principal name used for login (e.g.,user@REALM).setServicePrincipalName(String servicePrincipalName) The Kerberos service principal name (SPN) for the target service.setUseTicketCache(boolean useTicketCache) Whether to use the system ticket cache for authentication.toString()
-
Constructor Details
-
KerberosConfig
public KerberosConfig()
-
-
Method Details
-
getServicePrincipalName
The Kerberos service principal name (SPN) for the target service. Typically in the formHTTP/hostname@REALMorHTTP/hostname. -
getKrb5ConfigPath
Path to the Kerberos configuration file (krb5.conf). Ifnull, the JVM default is used (e.g.,/etc/krb5.confon Linux or the value ofjava.security.krb5.conf). -
getKeytabPath
Path to a keytab file containing the principal's key. When set, authentication uses this keytab instead of requiring a password or ticket cache. -
getPrincipal
The Kerberos principal name used for login (e.g.,user@REALM). Required when using a keytab file. When not using a keytab, the credentials fromHttpAuthConfig.getCredentials()are used. -
isUseTicketCache
public boolean isUseTicketCache()Whether to use the system ticket cache for authentication. Whentrue, an existing ticket obtained viakinit(or OS-level SSO) is used and no password or keytab is required. Default isfalse. -
getLoginModuleName
The JAAS login module name. Whennull(default), a built-in JAAS configuration is created automatically based on the other properties in this class. Set this only if you have a custom JAAS login configuration file and entry name. -
setServicePrincipalName
The Kerberos service principal name (SPN) for the target service. Typically in the formHTTP/hostname@REALMorHTTP/hostname.- Returns:
this.
-
setKrb5ConfigPath
Path to the Kerberos configuration file (krb5.conf). Ifnull, the JVM default is used (e.g.,/etc/krb5.confon Linux or the value ofjava.security.krb5.conf).- Returns:
this.
-
setKeytabPath
Path to a keytab file containing the principal's key. When set, authentication uses this keytab instead of requiring a password or ticket cache.- Returns:
this.
-
setPrincipal
The Kerberos principal name used for login (e.g.,user@REALM). Required when using a keytab file. When not using a keytab, the credentials fromHttpAuthConfig.getCredentials()are used.- Returns:
this.
-
setUseTicketCache
Whether to use the system ticket cache for authentication. Whentrue, an existing ticket obtained viakinit(or OS-level SSO) is used and no password or keytab is required. Default isfalse.- Returns:
this.
-
setLoginModuleName
The JAAS login module name. Whennull(default), a built-in JAAS configuration is created automatically based on the other properties in this class. Set this only if you have a custom JAAS login configuration file and entry name.- Returns:
this.
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-