Java configuration options

Each Enforcer has a set of configuration options that control the Enforcer’s functionality and features. While some are required, many of these are optional configurations that you can use to customize the Enforcer’s behavior. You can reference available configurations with this article. The HUMAN Java Enforcer is configured with a PXConfiguration instance passed to the PerimeterX constructor (and related builder APIs).

While all Enforcers come with the same set of required configurations, the optional configurations available for each may differ. We recommend updating to the latest Enforcer version to ensure you have access to the latest features and configurations.

Quick reference

Feature nameKeyTypeDefaultDescription
Application IDappIdString""HUMAN Application ID
Authentication tokenauthTokenString""HUMAN authentication token
Cookie secretcookieKeyString""HUMAN cookie secret
S2S timeoutapiTimeoutInteger1000Total time, in milliseconds, that the Enforcer will wait for the Risk API request to return before timing out and passing the request
Blocking scoreblockingScoreInteger1000-100. The minimum risk score that the Enforcer blocks from.

Required configurations

These configurations are necessary for the Enforcer’s basic functionality and features.

Basic functionality configurations

appId
stringRequired

Your HUMAN Application ID in the form of PX12AB34CD. You can copy this value from the HUMAN Console in Platform Settings > Applications Overview. If you have multiple applications, make sure to copy the ID of the application you want the Enforcer on.

Example
1PXConfiguration pxConf = PXConfiguration.builder()
2 // ...
3 .appId("APP_ID")
4 // ...
authToken
stringRequired

The application’s server token needed to authorize with HUMAN’s backend. You can copy this value from the HUMAN Console in Platform Settings > Applications Overview > Click the appropriate application > Server token tab.

Example
1PXConfiguration pxConf = PXConfiguration.builder()
2 // ...
3 .authToken("AUTH_TOKEN")
4 // ...
cookieKey
string | string[]Defaults to stringRequired

The secret used to encrypt and decrypt the risk cookie sent from the HUMAN Sensor. You can copy this value from the HUMAN Console in Sightline Cyberfraud Defense > Traffic Policy Overview > Click the appropriate application > Click the key > Copy value.

If you need to rotate secrets, then adjust this configuration to be an array of strings (string[]) and include the new secret and old secret. The new secret value should be the first value in the array. This prevents decryption failures.

1PXConfiguration pxConf = PXConfiguration.builder()
2 // ...
3 .cookieKey("COOKIE_KEY")
4 // ...
apiTimeout
integerDefaults to 1000Required

The total time in milliseconds that the Enforcer will wait for the Risk API request to return before timing out and passing the request.

Example
1PXConfiguration pxConf = PXConfiguration.builder()
2 // ...
3 .apiTimeout(2000)
4 // ...
blockingScore
integerDefaults to 100Required

The minimum risk score that the Enforcer will block. Ranges from 0 (lowest risk) to 100 (highest risk).

Example
1PXConfiguration pxConf = PXConfiguration.builder()
2 // ...
3 .blockingScore(20)
4 // ...

Basic feature configurations

setLoggerSeverity
LoggerSeverity.NONE | LoggerSeverity.ERROR | LoggerSeverity.DEBUGDefaults to LoggerSeverity.ERRORRequired

The severity at which the logger will output logs.

  • LoggerSeverity.NONE: The logger will not generate any logs.
  • LoggerSeverity.ERROR: The logger will only generate logs on fatal errors.
  • LoggerSeverity.DEBUG: The logger will generate detailed logs for debugging purposes. Not recommended for production environments.

See px_logger_auth_token for a header-based alternative.

The Java Enforcer uses SLF4J and Logback for logging.

Example
1import com.perimeterx.models.configuration.PXConfiguration;
2import com.perimeterx.utils.logger.LoggerSeverity;
3
4PXConfiguration.setPxLoggerSeverity(LoggerSeverity.DEBUG); // Can be called once; you do not need to call it on every request.
ipHeaders
string[]Defaults to []Required

An array of header names that are trusted to contain the true client IP. Headers are traversed in the order they’re listed, and the first header value will always be used as the client IP.

If not set, will be taken from default.

Use with the CombinedIPProvider interface.

Example
1PXConfiguration pxConf = PXConfiguration.builder()
2 // ...
3 .ipHeaders(new HashSet<>(Arrays.asList("x-px-true-ip", "x-true-ip")))
4 // ...
moduleEnabled
booleanDefaults to trueRequired

Whether the Enforcer module is enabled.

  • true: Enable the module
  • false: Disable the module
Example
1PXConfiguration pxConf = PXConfiguration.builder()
2 // ...
3 .moduleEnabled(false)
4 // ...
moduleMode
ModuleMode.BLOCKING | ModuleMode.MONITORDefaults to ModuleMode.MONITORRequired

The Enforcer’s operation mode.

  • ModuleMode.MONITOR: The Enforcer performs all functions without returning block responses. Useful for analyzing and adjusting Enforcer behavior without serving block pages to end users. If you have routes that must have enforcement at all times, see Enforced routes.
  • ModuleMode.BLOCKING: The Enforcer will return block responses as needed.
Example
1PXConfiguration pxConf = PXConfiguration.builder()
2 // ...
3 .moduleMode(ModuleMode.BLOCKING)
4 // ...

Optional configurations

These configurations aren’t required, but you can use them to further customize the Enforcer’s behavior.

Advanced blocking response (ABR)

advancedBlockingResponse
booleanDefaults to true

In specific cases such as XHR post requests, a full CAPTCHA page render might not be an option. In such cases, the Advanced Blocking Response (ABR) returns a JSON object containing all the information needed to render a customized CAPTCHA challenge implementation such as a popup modal, a section on the page, etc. This provides more flexibility and customizability in displaying the CAPTCHA challenge.

Example
1PXConfiguration pxConf = PXConfiguration.builder()
2 // ...
3 .advancedBlockingResponse(false)
4 // ...
5 .build();

Bypass monitor header

bypassMonitorHeader
stringDefaults to x-px-block

Activates the full blocking flow to verify the flow works as expected if a particular header is present on the request. Often used during monitor mode, where the Enforcer collects data without blocking user requests, before switching to ModuleMode.BLOCKING.

Example
1PXConfiguration pxConf = PXConfiguration.builder()
2 // ...
3 .bypassMonitorHeader("x-px-block")
4 // ...
5 .build();

Credentials Intelligence

These configurations are specific to Credentials Intelligence-related features in Sightline Cyberfraud Defense.

loginCredentialsExtractionEnabled
booleanDefaults to false

Whether to enable the extraction and reporting of credentials from the Enforcer for Credential Intelligence.

  • true: Enable Credential Intelligence
  • false: Disable Credential Intelligence
Example
1PXConfiguration pxConf = PXConfiguration.builder()
2 // ...
3 .loginCredentialsExtractionEnabled(true)
4 // ...
5 .build();
loginCredentialsExtractionDetails
CILoginMapDefaults to null

An array of configuration objects for each credential endpoint. Each element in the array is an object representing a distinct endpoint to which credentials are sent and includes:

  • How to identify these credential-bearing requests
  • How to extract the credentials from the request
  • How to determine if the request operation (login, signup, etc.) was successful based on the returned HTTP response
Example
1PXConfiguration pxConf = new PXConfiguration.Builder()
2 // ...
3 .loginCredentialsExtractionDetails(ciLoginMap)
4 // ...
5 .build();
ciProtocol
CIProtocol | V2Defaults to V2

Determines the structure and content of the user login data.

Example
1PXConfiguration pxConf = new PXConfiguration.Builder()
2 // ...
3 .ciProtocol(CIProtocol)
4 // ...
5 .build();
pxCompromisedCredentialsHeader
stringDefaults to px-compromised-credentials

The header name to be set on the incoming request if the credentials are compromised. If this header is added, its value will always be 1. If credentials have not been identified as compromised, the header will not be added to the request.

Example
1PXConfiguration pxConf = new PXConfiguration.Builder()
2 // ...
3 .pxCompromisedCredentialsHeader("x-px-compromised-credentials")
4 // ...
5 .build();
additionalS2SActivityHeaderEnabled
booleanDefaults to false

Whether to attach the additional_s2s payload and URL as headers to the original request. This is done so that the additional_s2s activity can be enriched with the proper login_successful value and sent to the provided URL at a later stage. This disables automatically sending additional_s2s activities.

When set to true, the following headers are added to the origin request:

  • px-additional-activity: A JSON object containing the payload of the additional_s2s activity. The login_successful and http_status_code fields should be set prior to sending the activity.
1{
2 "type": "additional_s2s",
3 "timestamp": 1637000000,
4 "socket_ip": "1.1.1.1",
5 "px_app_id": "PX_APP_ID",
6 "url": "https://www.example.com/the-target-url",
7 "vid": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
8 "details": {
9 "client_uuid": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
10 "request_id": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
11 "ci_version": "v1",
12 "http_status_code": null, // MODIFY, number (e.g., 200, 401, 404, etc.)
13 "login_successful": null, // MODIFY, boolean (e.g., true, false)
14 "raw_username": null // MODIFY, string (e.g., "test@mail.com")
15 }
16}
  • px-additional-activity-url: The URL to which the additional_s2s payload should be sent as an HTTP POST request.
Example
1private boolean additionalS2SActivityHeaderEnabled = true;
addRawUsernameOnAdditionalS2SActivity
booleanDefaults to false

Whether to report the raw username on the additional_s2s activity.

  • false: The raw username will never be reported.
  • true: The raw username will only be reported if:
    • The credentials are compromised, and
    • The login request was successful.
Example
1private boolean addRawUsernameOnAdditionalS2SActivity = true;
loginResponseValidationReportingMethod
LoginResponseValidationReportingMethod.STATUS | LoginResponseValidationReportingMethod.HEADER | LoginResponseValidationReportingMethod.BODY | LoginResponseValidationReportingMethod.CUSTOMDefaults to null

Method name that determines how to validate if the login was successful. There are several ways to report the success or failure of the login attempt. If left empty, the login success status is always reported as false.

Provide a status or array of statuses that represent a successful login. If a response’s status code matches the provided value or one of the values in the provided array, the login success status is set to true. Otherwise, it is set to false.

To define a range of statuses, use the CUSTOM reporting method.

Default values:

  • px_login_successful_status: 200
1private int[] loginResponseValidationStatusCode = {200};

Provide a string or regular expression with which to parse the response body. If a match is found, the login success status is set to true. If no match is found, the login success status is set to false.

Default values:

  • regexPatternToValidateLoginResponseBody: Empty
1private String regexPatternToValidateLoginResponseBody = "You logged in successfully!" // string or RegExp

Provide a custom class that implements the LoginResponseValidator interface and overrides isSuccessfulLogin, which receives a ResponseWrapper and returns a boolean.

Default values:

  • customLoginResponseValidator: empty
1public class DefaultCustomLoginResponseValidator implements LoginResponseValidator {
2
3 @Override
4 public boolean isSuccessfulLogin(HttpServletResponseWrapper response) {
5 return false;
6 }
7}
Example
1private LoginResponseValidationReportingMethod loginResponseValidationReportingMethod = LoginResponseValidationReportingMethod.STATUS
loginResponseValidationRegexBody
stringDefaults to null

Regex pattern that checks the response body in order to validate successful login.

Example
1PXConfiguration pxConf = new PXConfiguration.Builder()
2 // ...
3 .loginResponseValidationRegexBody("You logged in successfully!")
4 // ...
5 .build();
headerNameToValidateLoginResponse
stringDefaults to x-px-login-successful

Header name used to validate whether the login is successful.

Example
1PXConfiguration pxConf = new PXConfiguration.Builder()
2 // ...
3 .headerNameToValidateLoginResponse("x-px-login-successful")
4 // ...
5 .build();
headerValueToValidateLoginResponse
stringDefaults to 1

Header value used to validate whether the login is successful.

Example
1PXConfiguration pxConf = PXConfiguration.builder()
2 // ...
3 .headerValueToValidateLoginResponse("ok")
4 // ...
5 .build();
loginResponseValidationStatusCode
int[]Defaults to {200}

Array of status codes used to validate whether the login was successful.

Example
1PXConfiguration pxConf = new PXConfiguration.Builder()
2 // ...
3 .loginResponseValidationStatusCode(new int[] { 200, 201 })
4 // ...
5 .build();
customCookieHeader
stringDefaults to x-px-cookies

By default, the Enforcer extracts HUMAN cookies from the Cookie header. However, if these cookies are transferred on a different header, then that header’s name must be provided with this configuration.

Example
1PXConfiguration pxConf = PXConfiguration.builder()
2 // ...
3 .customCookieHeader("x-custom-cookies")
4 // ...
5 .build();

Custom parameters

customParametersExtraction
functionDefaults to null

Enriches activities sent from the Enforcer to HUMAN with additional custom parameters. This data can include user information, session IDs, or other data that HUMAN should have access to. These custom parameters are defined by a configurable function that must return an object that contains these custom parameters. There is a limit of 10 custom parameters.

The request body can only be read once! If you plan on reading the request body in this function, we recommend you using a request wrapper that caches the body before calling pxVerify

Parameters:

  • config: HumanSecurityConfiguration
  • request: HttpServletRequest

Returns: Promise<CustomParameters>

Example
1PXConfiguration pxConfiguration = PXConfiguration.builder()
2 ...
3 .customParametersExtraction((req) -> {
4 CustomParameters customParameters = new CustomParameters();
5 customParameters.setCustomParam1("example-value");
6 customParameters.setCustomParam2(req.getHeader("example-header"));
7 customParameters.setCustomParam3(123); // Numbers are supported
8 customParameters.setCustomParam4(true); // Booleans are supported
9 return customParameters;
10 })
11 .build();

Custom proxy

useProxy
booleanDefaults to false

Whether to use the proxyHost for message forwarding.

Example
1PXConfiguration pxConf = PXConfiguration.builder()
2 // ...
3 .useProxy(true)
4 // ...
5 .build();
proxyHost
stringDefaults to ""

If your architecture requires the use of a proxy server to access outside services, you can designate a proxy URL or IP port to use. This will use HTTP tunneling and direct all outgoing HUMAN traffic to the defined proxy address.

If using HTTPS, ensure that the proxy’s certificate is installed on the machine running the Enforcer.

Required if useProxy is true.

Example
1PXConfiguration pxConf = PXConfiguration.builder()
2 // ...
3 .proxyHost("proxy.example.com")
4 // ...
5 .build();
proxyPort
integerDefaults to 0

The proxy’s port. Required if useProxy is true.

Example
1PXConfiguration pxConf = PXConfiguration.builder()
2 // ...
3 .proxyPort(8080)
4 // ...
5 .build();

Encryption and buffering

encryptionEnabled
booleanDefaults to true

Whether to decode or decrypt a cookie.

Example
1PXConfiguration pxConf = PXConfiguration.builder()
2 // ...
3 .encryptionEnabled(false)
4 // ...
5 .build();
maxBufferLen
integerDefaults to 10

Sets the number of activities to send in batched activities.

Example
1PXConfiguration pxConf = PXConfiguration.builder()
2 // ...
3 .maxBufferLen(20)
4 // ...
5 .build();

Filters

staticFilesExt
Set<string>Defaults to ["css", "bmp", ... , "json"]

Filters out requests with the specified file extension. By default, HUMAN doesn’t enforce static assets such as images and documents to minimize unncessary API calls and computation, but you can configure this list at any time.

Filtering by extension only applies to GET and HEAD HTTP methods.

Example
1PXConfiguration pxConf = PXConfiguration.builder()
2 // ...
3 .staticFilesExt(new HashSet<>(Arrays.asList("css", "js", "png")))
4 // ...
5 .build();

Header data enrichment

These configurations let you add headers to incoming requests with additional data.

pxDataEnrichmentHeaderName
stringDefaults to ""

Adds a header to the incoming request with the configured header name and the JSON-stringified data enrichment object as the value. If empty or if data enrichment has not been enabled for your policy, no header will be set. To view available data and enable this feature, see Data classification enrichment.

Example
1PXConfiguration config = new PXConfiguration.Builder()
2 ...
3 .pxDataEnrichmentHeaderName("X-PX-Data-Enrichment")
4 .build();
5PerimeterX enforcer = new PerimeterX(config);
6
7// In your filter:
8PXContext ctx = enforcer.pxVerify(request, response);
9
10// After pxVerify, the request now contains the data enrichment header
11// and can be forwarded to your backend/origin server
12// The header will be available as "X-PX-Data-Enrichment" in the request
13filterChain.doFilter(request, response);

HUMAN Challenge & hard block customization

These configurations let you customize the HUMAN Challenge block page as well as the hard block page, which appears when a request is blocked without a Challenge. Hard block pages inherit the same styling as the HUMAN Challenge according to the following configurations and cannot be customized separately.

cssRef
string

A way to include a custom CSS file to the block page.

Maps to {{cssRef}} in the block page template.

Example
1PXConfiguration pxConf = PXConfiguration.builder()
2 // ...
3 .cssRef("https://www.example.com/custom_style.css")
4 // ...
5 .build();
jsRef
string

A way to include custom JavaScript to the block page. This script will run after the default JavaScript scripts.

Maps to {{jsRef}} in the block page template.

Example
1PXConfiguration pxConf = PXConfiguration.builder()
2 // ...
3 .jsRef("https://www.example.com/custom_script.js")
4 // ...
5 .build();
stringDefaults to ""

Adds a custom logo to the HUMAN Challenge block page via URL.

Maps to {{customLogo}} in the block page template.

Example
1PXConfiguration pxConf = PXConfiguration.builder()
2 // ...
3 .customLogo("https://www.example.com/custom_logo.png")
4 // ...
5 .build();

Monitored and enforced routes

These configurations let you define specific routes that should be enforced by HUMAN when the Enforcer is in monitor mode. These routes will always be subject to the full Enforcer workflow, including blocking requests if necessary.

enforcedRoutes
Set<string>Defaults to []

An array of routes or prefixes that should be enforced by HUMAN even when the Enforcer is in monitor mode.

Example
1PXConfiguration pxConf = PXConfiguration.builder()
2 // ...
3 .enforcedRoutes(new HashSet<>(Arrays.asList("/checkout", "/api/payment")))
4 // ...
5 .build();
monitoredRoutes
Set<string>Defaults to []

A list of endpoints to be monitored rather than blocked by the Enforcer, even when the Enforcer is in ModuleMode.BLOCKING mode.

Example
1PXConfiguration pxConf = PXConfiguration.builder()
2 // ...
3 .monitoredRoutes(new HashSet<>(Arrays.asList("/status", "/health")))
4 // ...
5 .build();

Network configuration

connectionTimeout
integerDefaults to 1000

TCP connection timeout to HUMAN servers, in milliseconds.

Example
1PXConfiguration pxConf = PXConfiguration.builder()
2 // ...
3 .connectionTimeout(2000)
4 // ...
5 .build();
maxConnectionsPerRoute
integerDefaults to 50

The maximum connections per route for Risk API requests in the connections pool.

Example
1PXConfiguration pxConf = PXConfiguration.builder()
2 // ...
3 .maxConnectionsPerRoute(100)
4 // ...
5 .build();
maxConnections
integerDefaults to 200

The total maximum connections for Risk API client.

Example
1PXConfiguration pxConf = PXConfiguration.builder()
2 // ...
3 .maxConnections(300)
4 // ...
5 .build();
sendPageActivities
booleanDefaults to true

Toggle sending asynchronous page activities.

Example
1PXConfiguration pxConf = PXConfiguration.builder()
2 // ...
3 .sendPageActivities(false)
4 // ...
5 .build();
serverURL
stringDefaults to https://sapi-<app_id>.perimeterx.net

Set the base url for HUMAN servers

Example
1PXConfiguration pxConf = new PXConfiguration.Builder()
2 // ...
3 .serverUrl("https://custom-collector.example.com")
4 // ...
5 .build();
securedPxhdEnabled
booleanDefaults to false

The PX Hashed Data (PXHD) cookie links the first risk request with the browser activities as detected by the Sensor for better user tracking. It can also add more information that’s shared between the HUMAN Collector, Enforcer, and Sensor. This configuration determines whether the Secure cookie attribute is added when setting the PXHD cookie.

See Use of cookies & web storage for more information.

Example
1PXConfiguration pxConf = PXConfiguration.builder()
2 // ...
3 .securedPxhdEnabled(true)
4 // ...
5 .build();

Remote configuration

Remote Configuration lets you update your Enforcer’s configuration from the HUMAN portal rather than interacting with the Enforcer package directly.

loggerAuthToken
stringDefaults to ""

An alternative to the basic logger configuration. This sends Enforcer logs to HUMAN’s logging service if a specific header is present on the request. This is particularly useful for expedited debugging, diagnosis, and resolution of any integration or Enforcer-related issues.

Contact HUMAN to recieve your token.

Example
1PXConfiguration pxConf = PXConfiguration.builder()
2 // ...
3 .loggerAuthToken("LOGGER_AUTH_TOKEN")
4 // ...
5 .build();
remoteConfigurationInterval
integerDefaults to 5000

The interval time in milliseconds to wait between attempts to fetch the Remote Configuration.

Example
1PXConfiguration pxConf = PXConfiguration.builder()
2 // ...
3 .remoteConfigurationInterval(15000)
4 // ...
5 .build();
remoteConfigurationDelay
integerDefaults to 0

The amount of time to delay the remote configuration thread before it starts

Example
1PXConfiguration pxConf = PXConfiguration.builder()
2 // ...
3 .remoteConfigurationDelay(1000)
4 // ...
5 .build();
remoteConfigurationUrl
string

Set the URL for HUMAN configuration service

Example
1PXConfiguration pxConf = PXConfiguration.builder()
2 // ...
3 .remoteConfigurationUrl("https://configurations.perimeterx.net")
4 // ...
5 .build();

Requests queue interval

validateRequestQueueInterval
integerDefaults to 5

Interval in seconds of cleaning requests queue. Solves HttpComponent reference leak bug.

Example
1PXConfiguration pxConf = PXConfiguration.builder()
2 // ...
3 .validateRequestQueueInterval(10)
4 // ...
5 .build();

Sensitive headers and routes

sensitiveHeaders
Set<string>Defaults to ["cookie", "cookies"]

Specifies certain headers that should not be forwarded to any other destination, including the HUMAN Detector. While HUMAN’s detection system will continue to use these headers to determine whether to block or not, the specified headers won’t be forwarded from the Enforcer, won’t appear in Enforcer activities, and won’t be sent to any other IP if the Enforcer acts as a proxy.

Example
1PXConfiguration pxConf = PXConfiguration.builder()
2 // ...
3 .sensitiveHeaders(new HashSet<>(Arrays.asList("cookie", "authorization")))
4 // ...
5 .build();
sensitiveRoutes
Set<string>Defaults to []

A list of prefixes for all routes that should be considered sensitive.

Example
1PXConfiguration pxConf = PXConfiguration.builder()
2 // ...
3 .sensitiveRoutes(new HashSet<>(Arrays.asList("/login", "/checkout")))
4 // ...
5 .build();
sensitiveRoutesRegex
Set<string>Defaults to []

Regex strings for routes that should be considered sensitive.

Example
1PXConfiguration pxConf = PXConfiguration.builder()
2 // ...
3 .sensitiveRoutesRegex(new HashSet<>(Arrays.asList("^/api/login$", "^/api/users/.*/password$")))
4 // ...
5 .build();
customIsSensitiveRequest
Predicate<HttpServletRequest>Defaults to (req) -> false

This configuration is meant for cases that require more complex logic. We recommended you use sensitiveRoutes for most cases.

A custom function that lets you define which requests should be considered sensitive based on custom logic. It accepts the incoming request as an argument and returns a boolean indicating whether the request should be considered sensitive.

Parameters:

  • request: function

Returns: A boolean or a Promise resolving to a boolean.

Example
1PXConfiguration pxConfiguration = new PXConfiguration.Builder()
2 ...
3 .customIsSensitiveRequest((req) -> req.getHeader("example-header") == "example-value")
4 .build();

Testing mode

testingMode
booleanDefaults to false

Runs the Enforcer in a development environment for testing purposes. The response returns as a JSON object. When you run the Enforcer in testing mode, do not set a custom verification handler

Example
1PXConfiguration pxConf = PXConfiguration.builder()
2 // ...
3 .testingMode(true)
4 // ...
5 .build();

Users identifiers

These configurations are related to Accounts and Account Takeover or Fake Account features in Sightline Cyberfraud Defense.

pxJwtCookieName
stringDefaults to ""

The name of the cookie that contains the JWT token that HUMAN should extract user identifiers from.

Example
1PXConfiguration pxConf = PXConfiguration.builder()
2 // ...
3 .pxJwtCookieName("auth")
4 // ...
5 .build();
pxJwtCookieUserIdFieldName
stringDefaults to ""

The field name in the JWT object, extracted from the JWT cookie, that contains the user ID to be extracted and reported.

Example
1PXConfiguration pxConf = PXConfiguration.builder()
2 // ...
3 .pxJwtCookieUserIdFieldName("nameID")
4 // ...
5 .build();
pxJwtCookieAdditionalFieldNames
string[]Defaults to []

The field names in the JWT object, extracted from the JWT cookie, that should be extracted and reported in addition to the user ID.

Example
1PXConfiguration pxConf = PXConfiguration.builder()
2 // ...
3 .pxJwtCookieAdditionalFieldNames(Arrays.asList("exp", "iss"))
4 // ...
5 .build();
pxJwtHeaderName
stringDefaults to ""

The name of the header that contains the JWT token that HUMAN should extract user identifiers from.

Example
1PXConfiguration pxConf = PXConfiguration.builder()
2 // ...
3 .pxJwtHeaderName("x-jwt-authorization")
4 // ...
5 .build();
pxJwtHeaderUserIdFieldName
stringDefaults to ""

The field name in the JWT object, extracted from the JWT header, that contains the user ID to be extracted and reported.

Example
1PXConfiguration pxConf = PXConfiguration.builder()
2 // ...
3 .pxJwtHeaderUserIdFieldName("sub")
4 // ...
5 .build();
pxJwtHeaderAdditionalFieldNames
string[]Defaults to []

The field names in the JWT object, extracted from the JWT header, that should be extracted and reported in addition to the user ID.

Example
1PXConfiguration pxConf = PXConfiguration.builder()
2 // ...
3 .pxJwtHeaderAdditionalFieldNames(Arrays.asList("exp", "iss"))
4 // ...
5 .build();

Interfaces

You can use the following interfaces to tune the Java Enforcer to your specific needs. Interfaces should be set after you initialize the PerimeterX instance.

Example
1BlockHandler exampleBlockHandler = new ExampleBlockHandler();
2PXConfiguration pxConf = new PXConfiguration.Builder(exampleBlockHandler)
3 // This will set the blocking handler from the default one to
4 // the our custom block handler
5 .blockHandler()
6 .build();
7this.enforcer = new PerimeterX(pxConf)
8this.enforcer.setActivityHandler(new BlockingActivityHandler());
activityHandler
Defaults to BufferedActivityHandler

Handler for all asynchronous activities from type enforcer_telemetry, page_requested, and block.

  • Method: setActivityHandler
blockHandler
Defaults to DefaultBlockHandler

Blocking handle will be called when pxVerify will return that user is not verified.

  • Method: blockHandler
ipProvider
Defaults to CombinedIPProvider

Handles IP address extraction from request.

  • Method: setIpProvider
hostnameProvider
Defaults to DefaultHostnameProvider

Handles hostname extraction from request.

  • Method: setHostnameProvider
verificationHandler
Defaults to DefaultVerificationHandler

Handling verification after HUMAN service finished analyzing the request.

  • Method: setVerificationHandler
customParametersProvider
Defaults to CustomParametersProvider

Adds to all activities additional custom parameters.

  • Method: customParametersProvider
loginResponseValidator
Defaults to LoginResponseValidator

Validate if the Login response was successful.

  • Method: isSuccessfulLogin
credentialsExtractor
Defaults to LoginCredentials

Extract credentials from login request.

  • Method: extractCredentials