Security
Capricorn APIs use authentication and authorization controls so only approved supplier systems can access Capricorn services.
Security at a Glance
| Security Component | Purpose |
|---|---|
client_id | Identifies the API consumer. |
client_secret | Authenticates the API consumer. |
x-captoken | Authorizes access to Capricorn APIs. |
| HTTPS | Secures communication between supplier systems and Capricorn. |
client_id and client_secret are issued together as client credentials for authentication, while x-captoken is used for authorization after authentication succeeds.
Authentication
Authentication confirms the identity of the calling application before Capricorn processes the request.
client_id
client_secret
A supplier application calls the Get Account API. Capricorn first validates the supplied client_id and client_secret and then checks the required x-captoken before processing the request.
Authorization
Authorization follows successful authentication and determines whether the application is permitted to perform the requested operation.
Capricorn uses it as the authorization credential and validates it against the services provisioned for the supplier integration before the request can continue.
x-captoken
Authorization ensures approved integrations can access only the services provisioned to them.
x-captoken
The x-captoken header is the authorization credential used to confirm that the calling application can access the requested Capricorn service.
- The
x-captokenheader is mandatory for all Capricorn API requests. - The token is supplied during supplier onboarding.
- Missing or invalid
x-captokenvalues prevent request authorization. - The token is long-lived and authorizes access to approved Capricorn services.
Security Flow
- Step 1: Supplier ApplicationStarts the request to Capricorn.
- Step 2:
client_id+client_secretAuthentication validates the calling application. - Step 3:
x-captokenAuthorization confirms access to the provisioned service. - Step 4: Capricorn APIAccepts the request after authentication and authorization succeed.
- Step 5: Request ProcessingBegins within Capricorn once the approved request reaches the service.
Each request is authenticated using client_id and client_secret, authorized using x-captoken, and then processed by the Capricorn API.
Integration Security Tips
- CredentialsStore
client_idandclient_secretsecurely and use them only for approved Capricorn integrations. x-captokenInclude the requiredx-captokenheader when calling Capricorn APIs.- Secure TransportUse HTTPS for all Capricorn API communications.
- Organisation BoundariesDo not share credentials or authorization tokens across organisations.
HTTPS Required
All communications with Capricorn APIs must use HTTPS. HTTP connections are not supported. Supplier callback URLs and supplier identity-handover endpoints must also use HTTPS.
Credential Management
- Store credentials in a secure secrets-management solution.
- Do not hard-code credentials.
- Do not commit credentials to source control.
- Restrict credential access to only the services that require them.
State Validation
This guidance applies only to Payment Intent integrations that use the browser callback flow.
It applies to the Payment Intent state request-body field and the returned state callback parameter used during that browser callback flow. Refer to the Payment Intent Reference for the canonical callback-flow request and parameter definitions.
The state value supplied during Payment Intent creation should be retained by the supplier application.
When the browser returns through the configured callback URL, validate that the returned
statecallback parameter exactly matches the originalstatevalue before continuing processing. If the values do not match, stop processing the callback response.
Callback URL Validation
- Callback URLs must use HTTPS.
- Callback URLs must be pre-approved during supplier onboarding and restricted to those approved domains.
Identity Handover Security
This guidance applies only to Member Identity Handover integrations. Refer to Member Identity Handover for the full request and response contract. In that document:
- The supplier handover
POSTis the HTTPS request that myCAP sends to the supplier's identity-handover endpoint. x-api-keyis the incoming request header on that supplier handoverPOST.authContextTokenis the request-body field in that handover request.returnUrlis the response-body field returned in the supplier's successful handover response.
These values are handover-specific controls for the supplier endpoint and do not replace the client_id, client_secret, and x-captoken credentials required when the supplier later calls Capricorn APIs.
- Validate
x-api-keyon incoming requests. - Store
authContextTokensecurely. - Return only approved
returnUrldestinations. - Use HTTPS for identity-handover endpoints.