Class HttpAuthConfig
java.lang.Object
com.norconex.crawler.web.fetch.impl.httpclient.HttpAuthConfig
Generic HTTP Fetcher authentication configuration.
- Since:
- 3.0.0
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanGets the NTLM authentication domain.The authentication form character set for the form field values.getFormParam(String name) Gets an authentication form parameter (equivalent to "input" or other fields in HTML forms).Gets all authentication form parameter names.Gets all authentication form parameters (equivalent to "input" or other fields in HTML forms).The name of the HTML field where the password is set.The CSS selector that identifies the form in a login page.The name of the HTML field where the username is set.getHost()The host for the current authentication scope.Kerberos/SPNEGO configuration.The authentication method.getRealm()The realm name for the current authentication scope.getUrl()The URL for "form" authentication.The NTLM authentication workstation name.inthashCode()booleanWhether to perform preemptive authentication (valid for "basic" authentication method).voidsetCredentials(Credentials authCredentials) Gets the NTLM authentication domain.setFormCharset(Charset formCharset) The authentication form character set for the form field values.voidsetFormParam(String name, String value) Sets an authentication form parameter (equivalent to "input" or other fields in HTML forms).voidsetFormParams(Map<String, String> params) Sets authentication form parameters (equivalent to "input" or other fields in HTML forms).setFormPasswordField(String formPasswordField) The name of the HTML field where the password is set.setFormSelector(String formSelector) The CSS selector that identifies the form in a login page.setFormUsernameField(String formUsernameField) The name of the HTML field where the username is set.The host for the current authentication scope.setKerberosConfig(KerberosConfig kerberosConfig) Kerberos/SPNEGO configuration.setMethod(HttpAuthMethod method) The authentication method.setPreemptive(boolean preemptive) Whether to perform preemptive authentication (valid for "basic" authentication method).The realm name for the current authentication scope.The URL for "form" authentication.setWorkstation(String workstation) The NTLM authentication workstation name.toString()
-
Constructor Details
-
HttpAuthConfig
public HttpAuthConfig()
-
-
Method Details
-
getCredentials
-
setCredentials
-
setFormParam
Sets an authentication form parameter (equivalent to "input" or other fields in HTML forms).- Parameters:
name- form parameter namevalue- form parameter value
-
setFormParams
Sets authentication form parameters (equivalent to "input" or other fields in HTML forms).- Parameters:
params- map of form parameter names and values
-
getFormParam
Gets an authentication form parameter (equivalent to "input" or other fields in HTML forms).- Parameters:
name- form parameter name- Returns:
- form parameter value or
nullif no match is found
-
getFormParams
Gets all authentication form parameters (equivalent to "input" or other fields in HTML forms).- Returns:
- form parameters map (name and value)
-
getFormParamNames
Gets all authentication form parameter names. If no form parameters are set, it returns an empty array.- Returns:
- HTTP request header names
-
getMethod
The authentication method. -
getUrl
The URL for "form" authentication. The username and password will be POSTed to this URL unlesssetFormSelector(String)is set, then it is assumed to be the URL of the page containing the form. This is used only for "form" authentication. -
getFormUsernameField
The name of the HTML field where the username is set. This is used only for "form" authentication. -
getFormPasswordField
The name of the HTML field where the password is set. This is used only for "form" authentication. -
getHost
The host for the current authentication scope.null(default value) indicates "any host" for the scope. Used for BASIC and DIGEST authentication. -
getRealm
The realm name for the current authentication scope.null(default) indicates "any realm" for the scope. Used for BASIC and DIGEST authentication. -
getFormCharset
The authentication form character set for the form field values. Default is UTF-8. -
getFormSelector
The CSS selector that identifies the form in a login page. When set, requiresgetUrl()to be pointing to a login page containing a login form. -
getWorkstation
The NTLM authentication workstation name. -
getDomain
Gets the NTLM authentication domain. -
getKerberosConfig
Kerberos/SPNEGO configuration. Required when usingHttpAuthMethod.SPNEGOorHttpAuthMethod.KERBEROS. -
isPreemptive
public boolean isPreemptive()Whether to perform preemptive authentication (valid for "basic" authentication method). -
setMethod
The authentication method.- Returns:
this.
-
setUrl
The URL for "form" authentication. The username and password will be POSTed to this URL unlesssetFormSelector(String)is set, then it is assumed to be the URL of the page containing the form. This is used only for "form" authentication.- Returns:
this.
-
setFormUsernameField
The name of the HTML field where the username is set. This is used only for "form" authentication.- Returns:
this.
-
setFormPasswordField
The name of the HTML field where the password is set. This is used only for "form" authentication.- Returns:
this.
-
setHost
The host for the current authentication scope.null(default value) indicates "any host" for the scope. Used for BASIC and DIGEST authentication.- Returns:
this.
-
setRealm
The realm name for the current authentication scope.null(default) indicates "any realm" for the scope. Used for BASIC and DIGEST authentication.- Returns:
this.
-
setFormCharset
The authentication form character set for the form field values. Default is UTF-8.- Returns:
this.
-
setFormSelector
The CSS selector that identifies the form in a login page. When set, requiresgetUrl()to be pointing to a login page containing a login form.- Returns:
this.
-
setWorkstation
The NTLM authentication workstation name.- Returns:
this.
-
setDomain
Gets the NTLM authentication domain.- Returns:
this.
-
setKerberosConfig
Kerberos/SPNEGO configuration. Required when usingHttpAuthMethod.SPNEGOorHttpAuthMethod.KERBEROS.- Returns:
this.
-
setPreemptive
Whether to perform preemptive authentication (valid for "basic" authentication method).- Returns:
this.
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-