Overview
The Box Connector provides functionality to retrieve files from Box.com cloud storage and register them in the Fess index.
This feature requires the fess-ds-box plugin.
Prerequisites
Plugin installation is required
A Box developer account and application creation is required
JWT (JSON Web Token) authentication or OAuth 2.0 authentication setup is required
Installing the Plugin
Method 1: Direct JAR file placement
# Download from Maven Central
wget https://repo1.maven.org/maven2/org/codelibs/fess/fess-ds-box/X.X.X/fess-ds-box-X.X.X.jar
# Place the file
cp fess-ds-box-X.X.X.jar $FESS_HOME/app/WEB-INF/lib/
# or
cp fess-ds-box-X.X.X.jar /usr/share/fess/app/WEB-INF/lib/
Method 2: Install from admin console
Open “System” -> “Plugins”
Upload the JAR file
Restart Fess
Configuration
Configure in the admin console under “Crawler” -> “Data Store” -> “Create New”.
Basic Settings
| Item | Example |
|---|---|
| Name | Company Box Storage |
| Handler Name | BoxDataStore |
| Enabled | On |
Parameter Configuration
JWT authentication example (recommended):
client_id=hdf8a7sd9f8a7sdf9a87sdf98a7sd
client_secret=kMN7sd8f7a9sd8f7a9sd8f7a9sd8f
public_key_id=4tg5h6j7
private_key=<YOUR_PRIVATE_KEY>
passphrase=7ba8sd9f7a9sd8f7a9sd8f7a9sd8f
enterprise_id=1923456
Parameter List
| Parameter | Required | Description |
|---|---|---|
client_id | Yes | Box application client ID |
client_secret | Yes | Box application client secret |
public_key_id | Yes | Public key ID |
private_key | Yes | Private key (PEM format, newlines represented as \n) |
passphrase | Yes | Private key passphrase |
enterprise_id | Yes | Box enterprise ID |
Script Configuration
url=file.url
title=file.name
content=file.contents
mimetype=file.mimetype
filetype=file.filetype
filename=file.name
content_length=file.size
created=file.created_at
last_modified=file.modified_at
Available Fields
| Field | Description |
|---|---|
file.url | Link to open file in browser |
file.contents | File text content |
file.mimetype | File MIME type |
file.filetype | File type |
file.name | File name |
file.size | File size (bytes) |
file.created_at | Creation date |
file.modified_at | Last modified date |
For details, refer to Box File Object.
Box Authentication Setup
JWT Authentication Setup Steps
1. Create an Application in Box Developer Console
Access https://app.box.com/developers/console:
Click “Create New App”
Select “Custom App”
Select “Server Authentication (with JWT)” for authentication method
Enter app name and create
2. Application Configuration
In the “Configuration” tab:
Application Scopes:
Check “Read all files and folders stored in Box”
Advanced Features:
Click “Generate a Public/Private Keypair”
Download the generated JSON file (important!)
App Access Level:
Select “App + Enterprise Access”
4. Obtain Authentication Credentials
Obtain the following information from the downloaded JSON file:
{
"boxAppSettings": {
"clientID": "hdf8a7sd...", // client_id
"clientSecret": "kMN7sd8f...", // client_secret
"appAuth": {
"publicKeyID": "4tg5h6j7", // public_key_id
"privateKey": "-----BEGIN...", // private_key
"passphrase": "7ba8sd9f..." // passphrase
}
},
"enterpriseID": "1923456" // enterprise_id
}
Private Key Format
Replace newlines in private_key with \n to make it a single line:
private_key=-----BEGIN ENCRYPTED PRIVATE KEY-----\nMIIFDjBABgk...=\n-----END ENCRYPTED PRIVATE KEY-----\n
Usage Examples
Crawling Entire Company Box Storage
Parameters:
client_id=abc123def456ghi789jkl012mno345
client_secret=pqr678stu901vwx234yz567abc890
public_key_id=a1b2c3d4
private_key=-----BEGIN ENCRYPTED PRIVATE KEY-----\nMIIFDjBABgkqhkiG9w0BBQ0wOzAbBgkqhkiG9w0BBQwwDgQI...=\n-----END ENCRYPTED PRIVATE KEY-----\n
passphrase=1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p
enterprise_id=123456789
Script:
url=file.url
title=file.name
content=file.contents
mimetype=file.mimetype
filetype=file.filetype
filename=file.name
content_length=file.size
created=file.created_at
last_modified=file.modified_at
Troubleshooting
Authentication Errors
Symptom: Authentication failed or Invalid grant
Check:
Verify
client_idandclient_secretare correctVerify private key is correctly copied (newlines are
\n)Verify passphrase is correct
Verify app is authorized in Box admin console
Verify
enterprise_idis correct
Private Key Format Errors
Symptom: Invalid private key format
Resolution:
Verify newlines are correctly converted to \n:
# Correct format
private_key=-----BEGIN ENCRYPTED PRIVATE KEY-----\nMIIFDj...\n-----END ENCRYPTED PRIVATE KEY-----\n
# Incorrect format (contains actual newlines)
private_key=-----BEGIN ENCRYPTED PRIVATE KEY-----
MIIFDj...
-----END ENCRYPTED PRIVATE KEY-----
Cannot Retrieve Files
Symptom: Crawl succeeds but 0 files
Check:
Verify “Read all files and folders” is enabled in Application Scopes
Verify App Access Level is set to “App + Enterprise Access”
Verify files actually exist in Box storage
Verify service account has appropriate permissions
Reference Information
Data Store Connector Overview - Data Store Connector Overview
Dropbox Connector - Dropbox Connector
Google Workspace Connector - Google Workspace Connector
Data Store Crawling - Data Store Configuration Guide