JWKS Authentication Integration
The ESW SFCC Cartridge provides the capability to validate incoming webhooks using ESW’s public keys via JWKS (JSON Web Key Sets).
The ESW SFCC Cartridge provides the capability to validate incoming webhooks using ESW’s public keys via JWKS (JSON Web Key Sets).
While the cartridge supports basic authentication, JWKS removes the need to manage static credentials and simplifies webhook security configuration.
JWKS Configuration
To configure JWKS authentication, ensure the following components are correctly set up in Business Manager (BM).
Custom Objects
Import Metadata
Import the custom object definitions:
After import, the following custom object is created:
This object stores the public keys retrieved from ESW and is used during webhook validation.
Jobs
Import Metadata
Import the jobs configuration:
After import, the following job is available:
This job is responsible for fetching the latest JWKS keys from ESW.
Services
Import Metadata
Import the services configuration:
After import, the following service is available:
This service connects to ESW to retrieve the public keys used for webhook authentication.
Workflow Overview
Key Fetching
- The
eswGetJwksJobcalls theEswGetJwksService - The service retrieves the latest ESW public keys
- Keys are stored in the ESW_JWKS custom object in SFCC
- These keys are reused during webhook validation
Screenshot Code Snippet – Stored JWKS Key (Custom Object)
The following represents the JWT Validation Key stored in the ESW_JWKS custom object, as shown in Business Manager.
This key material is periodically refreshed via the
eswGetJwksJob.
Webhook Validation Flow
When a webhook is received, the cartridge performs the following validation steps:
- Checks the HTTP header:
- Attempts to validate the webhook signature using the stored JWKS key
- If validation fails:
- Re-fetches the JWKS keys
- Attempts validation again
- If validation still fails:
- Falls back to basic authentication (if enabled)
- If authentication fails entirely:
- An error response is returned to the webhook caller
Screenshot Code Snippet – Webhook Header
Authentication Failure Behaviour
- Invalid or expired keys result in validation failure
- Missing or invalid
esw-authorizationheaders result in rejection - If basic authentication is disabled, webhook calls fail immediately
Supported Webhooks
JWKS authentication is supported for the following ESW webhook events:
- Order Confirmation
- Inventory Updates
- Order Returns
- Appeasements
- Cancellations
Key Benefits of JWKS Authentication
- No static credentials to rotate
- Secure public key validation
- Automatic key refresh
- Fallback compatibility with basic authentication
- Reduced configuration overhead