Ana içeriğe geç

JOSE Implementation Policy

General Information​

Policy Type​

policy-jose-implementation

Endpoints​

List Policies​

GET /apiops/projects/{projectName}/apiProxies/{apiProxyName}/policies/

Add Policy​

POST /apiops/projects/{projectName}/apiProxies/{apiProxyName}/policies/{policyName}/

Update Policy​

PUT /apiops/projects/{projectName}/apiProxies/{apiProxyName}/policies/{policyName}/

Delete Policy​

DELETE /apiops/projects/{projectName}/apiProxies/{apiProxyName}/policies/{policyName}/

List Policies​

Endpoint​

GET /apiops/projects/{projectName}/apiProxies/{apiProxyName}/policies/

Request​

Headers​

HeaderValue
AuthorizationBearer {token}

Path Parameters​

ParameterTypeRequiredDescription
projectNamestringYesProject name
apiProxyNamestringYesAPI Proxy name

Response​

Success Response (200 OK)​

{
"status": "SUCCESS",
"resultList": [
{
"apiProxy": {
"name": "MyAPI",
"requestPolicyList": [],
"responsePolicyList": [
{
"type": "policy-jose-implementation",
"name": "jose-implementation-policy",
"description": "Generate JOSE tokens",
"active": true,
"joseTarget": "BODY",
"joseTargetVariable": null,
"jwtClaimsClaim": null,
"escapeJsonString": false,
"addIssueTime": true,
"addJWTID": true,
"addIssuer": true,
"issuer": "https://myapi.com",
"addAudience": true,
"audienceList": ["api://myapi"],
"addSubject": true,
"subject": "user123",
"addTypeToHeader": true,
"typeValue": "JWT",
"addExpirationTime": true,
"expirationTimeValue": 3600,
"expirationTimeUnit": "SECONDS",
"additionalClaimMap": {
"role": {
"value": "admin",
"valueType": "STRING"
}
},
"sign": true,
"signByIssuer": true,
"jwkIdForValidationAndSign": null,
"encrypt": true,
"encryptByIssuer": true,
"jwkIdForDecryptionAndEncryption": null,
"encryptionMethod": "A128CBC_HS256",
"encodedClaimsTargetForDataManipulation": "BODY",
"decodedClaimsTargetVariableForDataManipulation": null
}
],
"errorPolicyList": []
}
}
],
"resultCount": 1
}

cURL Example​

curl -X GET \
"https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/MyAPI/policies/" \
-H "Authorization: Bearer YOUR_TOKEN"

Add Policy​

Endpoint​

POST /apiops/projects/{projectName}/apiProxies/{apiProxyName}/policies/{policyName}/

Request​

Headers​

HeaderValue
AuthorizationBearer {token}
Content-Typeapplication/json

Path Parameters​

ParameterTypeRequiredDescription
projectNamestringYesProject name
apiProxyNamestringYesAPI Proxy name
policyNamestringYesPolicy name

Request Body​

Full JSON Body Example - Basic JWT Generation​
{
"operationMetadata": {
"targetScope": "ALL",
"targetPipeline": "RESPONSE",
"deploy": true,
"deployTargetEnvironmentNameList": ["production"],
"order": 1
},
"policy": {
"type": "policy-jose-implementation",
"description": "Generate signed JWT tokens",
"active": true,
"joseTarget": "BODY",
"joseTargetVariable": null,
"jwtClaimsClaim": null,
"escapeJsonString": false,
"addIssueTime": true,
"addJWTID": true,
"addIssuer": true,
"issuer": "https://myapi.com",
"addAudience": true,
"audienceList": ["api://myapi"],
"addSubject": true,
"subject": "user123",
"addTypeToHeader": true,
"typeValue": "JWT",
"addExpirationTime": true,
"expirationTimeValue": 3600,
"expirationTimeUnit": "SECONDS",
"additionalClaimMap": {
"role": {
"value": "admin",
"valueType": "STRING"
},
"permissions": {
"value": "read,write",
"valueType": "STRING_LIST"
}
},
"sign": true,
"signByIssuer": true,
"jwkIdForValidationAndSign": null,
"encrypt": false,
"encryptByIssuer": true,
"jwkIdForDecryptionAndEncryption": null,
"encryptionMethod": null,
"encodedClaimsTargetForDataManipulation": "BODY",
"decodedClaimsTargetVariableForDataManipulation": null
}
}
Full JSON Body Example - Signed and Encrypted JWE​
{
"operationMetadata": {
"targetScope": "ALL",
"targetPipeline": "RESPONSE",
"deploy": true,
"deployTargetEnvironmentNameList": ["production"],
"order": 1
},
"policy": {
"type": "policy-jose-implementation",
"description": "Generate signed and encrypted JWE tokens",
"active": true,
"joseTarget": "AUTHORIZATION_HEADER",
"joseTargetVariable": null,
"jwtClaimsClaim": null,
"escapeJsonString": false,
"addIssueTime": true,
"addJWTID": true,
"addIssuer": true,
"issuer": "https://myapi.com",
"addAudience": true,
"audienceList": ["api://myapi"],
"addSubject": true,
"subject": "user123",
"addTypeToHeader": true,
"typeValue": "JWT",
"addExpirationTime": true,
"expirationTimeValue": 3600,
"expirationTimeUnit": "SECONDS",
"additionalClaimMap": {
"role": {
"value": "admin",
"valueType": "STRING"
}
},
"sign": true,
"signByIssuer": true,
"jwkIdForValidationAndSign": null,
"encrypt": true,
"encryptByIssuer": true,
"jwkIdForDecryptionAndEncryption": null,
"encryptionMethod": "A128CBC_HS256",
"encodedClaimsTargetForDataManipulation": "BODY",
"decodedClaimsTargetVariableForDataManipulation": null
}
}
Full JSON Body Example - Using Proxy JWK​
{
"operationMetadata": {
"targetScope": "ALL",
"targetPipeline": "RESPONSE",
"deploy": true,
"deployTargetEnvironmentNameList": ["production"],
"order": 1
},
"policy": {
"type": "policy-jose-implementation",
"description": "Generate JWT using proxy JWK",
"active": true,
"joseTarget": "BODY",
"joseTargetVariable": null,
"jwtClaimsClaim": null,
"escapeJsonString": false,
"addIssueTime": true,
"addJWTID": true,
"addIssuer": true,
"issuer": "https://myapi.com",
"addAudience": true,
"audienceList": ["api://myapi"],
"addSubject": true,
"subject": "user123",
"addTypeToHeader": true,
"typeValue": "JWT",
"addExpirationTime": true,
"expirationTimeValue": 3600,
"expirationTimeUnit": "SECONDS",
"additionalClaimMap": {},
"sign": true,
"signByIssuer": false,
"jwkIdForValidationAndSign": "my-signing-jwk-id",
"encrypt": true,
"encryptByIssuer": false,
"jwkIdForDecryptionAndEncryption": "my-encryption-jwk-id",
"encryptionMethod": "A256GCM",
"encodedClaimsTargetForDataManipulation": "BODY",
"decodedClaimsTargetVariableForDataManipulation": null
}
}
Full JSON Body Example - Minimal Configuration​
{
"operationMetadata": {
"targetScope": "ALL",
"targetPipeline": "RESPONSE",
"deploy": true,
"deployTargetEnvironmentNameList": ["production"],
"order": 1
},
"policy": {
"type": "policy-jose-implementation",
"description": "Generate minimal JWT",
"active": true,
"joseTarget": "BODY",
"joseTargetVariable": null,
"jwtClaimsClaim": null,
"escapeJsonString": false,
"addIssueTime": false,
"addJWTID": false,
"addIssuer": false,
"issuer": null,
"addAudience": false,
"audienceList": [],
"addSubject": false,
"subject": null,
"addTypeToHeader": false,
"typeValue": null,
"addExpirationTime": false,
"expirationTimeValue": null,
"expirationTimeUnit": null,
"additionalClaimMap": {
"custom": {
"value": "value",
"valueType": "STRING"
}
},
"sign": false,
"signByIssuer": true,
"jwkIdForValidationAndSign": null,
"encrypt": false,
"encryptByIssuer": true,
"jwkIdForDecryptionAndEncryption": null,
"encryptionMethod": null,
"encodedClaimsTargetForDataManipulation": "BODY",
"decodedClaimsTargetVariableForDataManipulation": null
}
}
Full JSON Body Example - Variable Target​
{
"operationMetadata": {
"targetScope": "ALL",
"targetPipeline": "RESPONSE",
"deploy": true,
"deployTargetEnvironmentNameList": ["production"],
"order": 1
},
"policy": {
"type": "policy-jose-implementation",
"description": "Generate JWT to variable",
"active": true,
"joseTarget": "CHOOSE_FROM_VARIABLE",
"joseTargetVariable": {
"type": "HEADER",
"headerName": "X-JWT-Token"
},
"jwtClaimsClaim": null,
"escapeJsonString": false,
"addIssueTime": true,
"addJWTID": true,
"addIssuer": true,
"issuer": "https://myapi.com",
"addAudience": true,
"audienceList": ["api://myapi"],
"addSubject": true,
"subject": "user123",
"addTypeToHeader": true,
"typeValue": "JWT",
"addExpirationTime": true,
"expirationTimeValue": 3600,
"expirationTimeUnit": "SECONDS",
"additionalClaimMap": {},
"sign": true,
"signByIssuer": true,
"jwkIdForValidationAndSign": null,
"encrypt": false,
"encryptByIssuer": true,
"jwkIdForDecryptionAndEncryption": null,
"encryptionMethod": null,
"encodedClaimsTargetForDataManipulation": "CHOOSE_FROM_VARIABLE",
"decodedClaimsTargetVariableForDataManipulation": {
"type": "HEADER",
"headerName": "X-Encoded-Claims"
}
}
}
Full JSON Body Example - DPoP Proof Generation​
{
"operationMetadata": {
"targetScope": "ALL",
"targetPipeline": "REQUEST",
"deploy": true,
"deployTargetEnvironmentNameList": ["production"],
"order": 1
},
"policy": {
"type": "policy-jose-implementation",
"description": "Generate DPoP proof for sender-constrained token protection",
"active": true,
"enableDpop": true,
"dpopProofHeaderName": "DPoP",
"dpopHtuSource": "MANUAL",
"dpopHtu": "https://upstream-api.example.com/v1/resource",
"dpopHtm": null,
"dpopAddAth": true,
"dpopAccessTokenSource": "AUTHORIZATION_HEADER",
"dpopAccessTokenVariable": null,
"dpopRewriteAuthorizationScheme": true,
"dpopNonceVariable": null,
"joseTarget": "EMPTY",
"joseTargetVariable": null,
"jwtClaimsClaim": null,
"escapeJsonString": false,
"addIssueTime": false,
"addJWTID": false,
"addIssuer": false,
"issuer": null,
"addAudience": false,
"audienceList": [],
"addSubject": false,
"subject": null,
"addTypeToHeader": false,
"typeValue": null,
"addExpirationTime": false,
"expirationTimeValue": null,
"expirationTimeUnit": null,
"additionalClaimMap": {},
"sign": true,
"signByIssuer": false,
"jwkIdForValidationAndSign": "dpop-key-id",
"encrypt": false,
"encryptByIssuer": true,
"jwkIdForDecryptionAndEncryption": null,
"encryptionMethod": null,
"encodedClaimsTargetForDataManipulation": "BODY",
"decodedClaimsTargetVariableForDataManipulation": null
}
}

Request Body Fields​

operationMetadata​
FieldTypeRequiredDefaultDescription
targetScopestringYes-Policy scope: ALL or ENDPOINT
targetEndpointstringNo*-Endpoint path (required if targetScope=ENDPOINT)
targetEndpointHTTPMethodstringNo*-HTTP method (required if targetScope=ENDPOINT)
targetPipelinestringYes-Pipeline: REQUEST, RESPONSE, or ERROR
deploybooleanNotrueWhether to deploy after adding policy
deployTargetEnvironmentNameListarrayNo[]List of environment names to deploy to
orderintegerNonullPolicy execution order (starts from 1)

Enum: targetScope

  • ALL - Policy applies to all endpoints
  • ENDPOINT - Policy applies only to specified endpoint

Enum: targetPipeline

  • REQUEST - Executes in request pipeline (generates tokens for requests)
  • RESPONSE - Executes in response pipeline (generates tokens for responses)
  • ERROR - Executes in error pipeline

Enum: targetEndpointHTTPMethod

  • GET, POST, PUT, DELETE, PATCH, OPTIONS, HEAD
policy​
FieldTypeRequiredDefaultDescription
typestringYes-Policy type: policy-jose-implementation
descriptionstringNo-Policy description
activebooleanNotrueWhether policy is active
joseTargetstringYesBODYJOSE target location. See EnumJoseImplementationSignedTarget
joseTargetVariableobjectNo*nullVariable for JOSE target (required if joseTarget=CHOOSE_FROM_VARIABLE). See VariableDTO
jwtClaimsClaimstringNonullJWT claims claim name (for nested claims)
escapeJsonStringbooleanNofalseWhether to escape JSON string values
addIssueTimebooleanNotrueWhether to add issue time (iat) to JWT
addJWTIDbooleanNotrueWhether to add JWT ID (jti) to JWT
addIssuerbooleanNotrueWhether to add issuer (iss) to JWT
issuerstringNo*nullIssuer value (required if addIssuer=true)
addAudiencebooleanNotrueWhether to add audience (aud) to JWT
audienceListarrayNo*[]Audience list (required if addAudience=true, at least one required)
addSubjectbooleanNotrueWhether to add subject (sub) to JWT
subjectstringNo*nullSubject value (required if addSubject=true)
addTypeToHeaderbooleanNotrueWhether to add type (typ) to header
typeValuestringNo*nullType value (required if addTypeToHeader=true)
addExpirationTimebooleanNotrueWhether to add expiration time (exp) to JWT
expirationTimeValueintegerNo*nullExpiration time value (required if addExpirationTime=true, must be > 0)
expirationTimeUnitstringNo*nullExpiration time unit (required if addExpirationTime=true). See EnumTimeUnit
additionalClaimMapobjectNoMap of additional claims. See MapValue
signbooleanNotrueWhether to sign JWT
signByIssuerbooleanNotrueSign by issuer (true) or by proxy's JWK (false)
jwkIdForValidationAndSignstringNo*nullJWK ID for validation and signing (required if sign=true and signByIssuer=false)
encryptbooleanNotrueWhether to encrypt JWT
encryptByIssuerbooleanNotrueEncrypt by issuer (true) or by proxy's JWK (false)
jwkIdForDecryptionAndEncryptionstringNo*nullJWK ID for decryption and encryption (required if encrypt=true and encryptByIssuer=false)
dynamicKeyForValidationAndSignobjectNo-Dynamic HTTP key fetching configuration for the signing/validation key (see JoseDynamicKeyConfig Object)
dynamicKeyForDecryptionAndEncryptionobjectNo-Dynamic HTTP key fetching configuration for the encryption/decryption key (see JoseDynamicKeyConfig Object)
encryptionMethodstringNo*nullEncryption method (required if encrypt=true). See EnumJwkEncryptionMethod
enableDpopbooleanNofalseEnable DPoP proof generation for sender-constrained token protection
dpopProofHeaderNamestringNo"DPoP"Header name for DPoP proof (RFC 9449). Default is the RFC 9449 header name (DPoP).
dpopHtuSourcestringNo"MANUAL"Source for DPoP proof target URI: MANUAL (use dpopHtu) or BACKEND_ROUTING_ADDRESS (derive from backend routing)
dpopHtustringNo*nullDPoP proof target URI (required if dpopHtuSource=MANUAL). Supports variable substitution; query string and fragment are stripped
dpopHtmstringNonullDPoP proof HTTP method override (optional; defaults to request method). Supports variable substitution
dpopAddAthbooleanNotrueAdd access token hash to DPoP proof (RFC 9449 recommends true for token binding)
dpopAccessTokenSourcestringNo"AUTHORIZATION_HEADER"Source of access token for DPoP: AUTHORIZATION_HEADER, BODY, or VARIABLE
dpopAccessTokenVariableobjectNo*nullVariable containing access token (required if dpopAccessTokenSource=VARIABLE). See VariableDTO
dpopRewriteAuthorizationSchemebooleanNotrueRewrite Authorization scheme from Bearer to DPoP (DPoP-protected servers require this)
dpopNonceVariableobjectNonullVariable for DPoP nonce claim (server-provided replay protection, optional). See VariableDTO
encodedClaimsTargetForDataManipulationstringNoBODYTarget for encoded claims data manipulation. See EnumJoseTarget
decodedClaimsTargetVariableForDataManipulationobjectNo*nullVariable for encoded claims target (required if encodedClaimsTargetForDataManipulation=CHOOSE_FROM_VARIABLE). See VariableDTO

JoseDynamicKeyConfig Object​

Configuration for fetching a JOSE key over HTTP. Present twice on the policy: dynamicKeyForValidationAndSign (signing/validation key) and dynamicKeyForDecryptionAndEncryption (encryption/decryption key). Used when keySourceMode is DYNAMIC_HTTP; ignored for an embedded JWK.

FieldTypeRequiredDefaultDescription
keySourceModestringNo-EMBEDDED for a stored JWK, DYNAMIC_HTTP to fetch over HTTP
httpRequestobjectNo*-Key request definition (required when keySourceMode=DYNAMIC_HTTP)
keyExtractionVariableobjectNo*-Variable that extracts the key from the response (required when keySourceMode=DYNAMIC_HTTP)
keyFormatstringNo-AUTO_DETECT, PUBLIC_KEY, PRIVATE_KEY, CERTIFICATE or JWK_JSON
keyAlgorithmstringNoNONEKey algorithm; NONE lets Apinizer auto-detect
keyKidstringNo-Key id (kid) to select from a JWK Set
enableCachebooleanNofalseCache the fetched key
cacheByVariableobjectNo*-Variable used to build the key cache entry (required when enableCache=true)
keyCacheTtlintegerNo3600Key cache time-to-live in seconds
keyCacheCapacityintegerNo-Maximum number of cached key entries
keyRespectCacheInvalidationHeadersbooleanNotrueHonour Cache-Control headers returned by the key endpoint
keyCacheStorageTypestringNoDISTRIBUTEDLOCAL or DISTRIBUTED
keyCacheConnectionTimeoutintegerNo3Distributed key cache connection timeout in seconds
keyCacheErrorHandlingTypestringNoCONTINUEAction when the cache service is unreachable: CONTINUE or FAIL
retryOnKeyErrorbooleanNotrueOn a cryptographic key error, invalidate the cache and fetch the key once more
invalidateCacheOnValidationErrorbooleanNo-Invalidate the cached key when validation fails
httpRetrySettingsobjectNo-Retry settings for the key-fetch HTTP call itself (see RetrySettings Object)

httpRequest fields:

FieldTypeRequiredDefaultDescription
endpointUrlstringNo*-Full endpoint URL (endpointUrl or baseUrl is required)
baseUrlstringNo*-Base URL, used when endpointUrl is relative
httpMethodstringNo-HTTP method of the key request
headerListarrayNo[]Request headers as { "name": "...", "value": "..." }
parameterListarrayNo[]Query parameters as { "name": "...", "value": "..." }
bodyTypestringNo-NONE, RAW, FORM_DATA, URL_ENCODED or BINARY
requestBodystringNo-Raw request body (used when bodyType=RAW)
formDataListarrayNo[]Form-data fields (key, value, fieldType, fileName, contentType)
urlEncodedListarrayNo[]x-www-form-urlencoded fields, same shape as formDataList
timeoutintegerNo-Request timeout in seconds

RetrySettings Object (httpRetrySettings):

FieldTypeRequiredDefaultDescription
enabledbooleanNofalseEnable retry for the key request
retryCountintegerNo0Additional attempts after the first one
retryDelayTypestringNoNO_DELAYNO_DELAY, FIXED or EXPONENTIAL
retryFixedDelayMsintegerNo500Fixed wait before each retry
retryInitialDelayMsintegerNo500Wait before the first retry (EXPONENTIAL)
retryMaxDelayMsintegerNo10000Upper bound for the growing wait
retryBackoffMultipliernumberNo2.0Growth factor per step, must be greater than 1
retryOnStatusCodeListarrayNo[502, 503, 504]HTTP status codes that trigger a retry
retryNonIdempotentbooleanNofalseAllow retry for POST/PATCH on server responses
Note

retryOnKeyError and httpRetrySettings are different layers. retryOnKeyError clears the cached key and fetches it once more when the key itself is cryptographically unusable; httpRetrySettings retries the key request when it fails at the network level. Both can be enabled together — each fetch stays within its own retry limit.

Certificate and mTLS settings of the key request are not carried over the APIops API. They hold installation-specific secret material or ID references, so they are configured on the target installation; when an existing policy is updated, its current values are preserved.

Example — fetching the signing key over HTTP with cache and retry:

{
"name": "jose-dynamic-key-example",
"sign": true,
"signByIssuer": false,
"jwkIdForValidationAndSign": null,
"dynamicKeyForValidationAndSign": {
"keySourceMode": "DYNAMIC_HTTP",
"httpRequest": {
"endpointUrl": "https://idp.example.com/.well-known/jwks.json",
"httpMethod": "GET",
"headerList": [
{ "name": "Accept", "value": "application/json" }
],
"parameterList": [],
"bodyType": "NONE",
"timeout": 10
},
"keyExtractionVariable": {
"type": "BODY",
"bodyExpression": "$.keys[0]"
},
"keyFormat": "JWK_JSON",
"keyAlgorithm": "NONE",
"keyKid": "signing-key-1",
"enableCache": true,
"cacheByVariable": {
"type": "CONTEXT_VALUE",
"contextValue": "API_PROXY_NAME"
},
"keyCacheTtl": 3600,
"keyCacheCapacity": 100,
"keyRespectCacheInvalidationHeaders": true,
"keyCacheStorageType": "DISTRIBUTED",
"keyCacheConnectionTimeout": 3,
"keyCacheErrorHandlingType": "CONTINUE",
"retryOnKeyError": true,
"httpRetrySettings": {
"enabled": true,
"retryCount": 2,
"retryDelayType": "EXPONENTIAL",
"retryInitialDelayMs": 500,
"retryMaxDelayMs": 10000,
"retryBackoffMultiplier": 2.0,
"retryOnStatusCodeList": [502, 503, 504],
"retryNonIdempotent": false
}
}
}

In this example the key is fetched from a JWKS endpoint and cached for an hour. If the endpoint cannot be reached, the request is retried up to two more times with an exponentially growing wait. If the fetched key later turns out to be cryptographically unusable, retryOnKeyError clears the cache and fetches it once more.

EnumJoseImplementationSignedTarget​

  • BODY - Place JOSE token in request/response body
  • AUTHORIZATION_HEADER - Place JOSE token in Authorization header
  • CHOOSE_FROM_VARIABLE - Place JOSE token location specified by variable (requires joseTargetVariable)
  • EMPTY - Do not place token (for internal use only)

EnumTimeUnit​

  • MILLI_SECONDS - Milliseconds
  • SECONDS - Seconds
  • MINUTES - Minutes
  • HOURS - Hours
  • DAYS - Days
  • WEEKS - Weeks
  • MONTHS - Months
  • YEARS - Years

EnumJwkEncryptionMethod​

  • A128CBC_HS256 - AES-128-CBC with HMAC-SHA-256 (recommended)
  • A192CBC_HS384 - AES-192-CBC with HMAC-SHA-384
  • A256CBC_HS512 - AES-256-CBC with HMAC-SHA-512
  • A128CBC_HS256_DEPRECATED - AES-128-CBC with HMAC-SHA-256 (deprecated)
  • A256CBC_HS512_DEPRECATED - AES-256-CBC with HMAC-SHA-512 (deprecated)
  • A128GCM - AES-128-GCM
  • A192GCM - AES-192-GCM
  • A256GCM - AES-256-GCM (recommended for GCM)
  • XC20P - XChaCha20-Poly1305

EnumDpopHtuSource​

  • MANUAL - Use dpopHtu value (recommended for reverse proxy / TLS termination scenarios)
  • BACKEND_ROUTING_ADDRESS - Derive htu from gateway's routed backend address (best-effort; may differ in load-balancer / failover scenarios)

EnumDpopAccessTokenSource​

  • AUTHORIZATION_HEADER - Fetch access token from Authorization header
  • BODY - Fetch access token from request/response body
  • VARIABLE - Fetch access token from variable (requires dpopAccessTokenVariable)

EnumJoseTarget​

  • BODY - Place encoded claims in request/response body
  • AUTHORIZATION_HEADER - Place encoded claims in Authorization header
  • CHOOSE_FROM_VARIABLE - Place encoded claims in variable (requires decodedClaimsTargetVariableForDataManipulation)

Note​

  • If enableDpop: true, JWT claim fields (addIssueTime, addJWTID, addIssuer, addAudience, addSubject, addExpirationTime, additionalClaimMap, encrypt) are ignored; only proof generation is active. sign: true and asymmetric JWK (signByIssuer: false + jwkIdForValidationAndSign) are mandatory.
  • If enableDpop: true and dpopHtuSource: MANUAL, dpopHtu is required.
  • If dpopAccessTokenSource: VARIABLE, dpopAccessTokenVariable is required.
  • If dpopAddAth: true, access token must be available from specified source.
  • If joseTarget: CHOOSE_FROM_VARIABLE, joseTargetVariable is required.
  • If addIssuer: true, issuer is required.
  • If addAudience: true, audienceList is required and must contain at least one value.
  • If addSubject: true, subject is required.
  • If addTypeToHeader: true, typeValue is required.
  • If addExpirationTime: true, both expirationTimeValue (must be > 0) and expirationTimeUnit are required.
  • If sign: true and signByIssuer: false, jwkIdForValidationAndSign is required.
  • If encrypt: true, encryptionMethod is required.
  • If encrypt: true and encryptByIssuer: false, jwkIdForDecryptionAndEncryption is required.
  • If encodedClaimsTargetForDataManipulation: CHOOSE_FROM_VARIABLE, decodedClaimsTargetVariableForDataManipulation is required.

VariableDTO​

FieldTypeRequiredDefaultDescription
idstringNo-Variable ID (if referencing existing variable)
projectIdstringNo-Project ID (if referencing existing variable)
namestringNo*-Variable name (required if id not provided)
descriptionstringNo-Variable description
typestringYes-Variable type: HEADER, PARAMETER, BODY, CONTEXT_VALUES, CUSTOM
headerNamestringNo*-Header name (required if type=HEADER)
paramTypestringNo*-Parameter type: QUERY, PATH, FORM (required if type=PARAMETER)
paramNamestringNo*-Parameter name (required if type=PARAMETER)
paramPathstringNo-Parameter path
formNamestringNo-Form name (for form parameters)
xpathValuestringNo*-XPath value (required if type=BODY and content is XML)
jsonPathValuestringNo*-JSONPath value (required if type=BODY and content is JSON)
bodyJsonPathstringNo*-JSONPath value (alternative to jsonPathValue)
messageContentTypestringNo*-Message content type: JSON, XML, FORM (required if type=BODY)
contextValuestringNo*-Context value (required if type=CONTEXT_VALUES)
zoneIdstringNo-Zone ID (for date context values)
initWithScriptbooleanNofalseInitialize with script
scriptLanguagestringNo-Script language: GROOVY, JAVASCRIPT (required if initWithScript=true)
scriptBodystringNo-Script body (required if initWithScript=true)

EnumVariableType​

  • HEADER - HTTP header
  • PARAMETER - Query/path/form parameter
  • BODY - Request/response body
  • CONTEXT_VALUES - Context values (e.g., current time, IP address)
  • CUSTOM - Custom variable (script-based)

EnumVariableParameterType​

  • QUERY - Query parameter
  • PATH - Path parameter
  • FORM - Form parameter

EnumMessageContentType​

  • JSON - JSON content
  • XML - XML content
  • FORM - Form content

EnumVariableContextValue​

  • CURRENT_TIME - Current timestamp
  • CURRENT_DATE - Current date
  • CLIENT_IP - Client IP address
  • CLIENT_PORT - Client port
  • SERVER_IP - Server IP address
  • SERVER_PORT - Server port
  • REQUEST_METHOD - HTTP request method
  • REQUEST_URI - Request URI
  • REQUEST_PATH - Request path
  • REQUEST_QUERY_STRING - Query string
  • REQUEST_PROTOCOL - Request protocol
  • REQUEST_HOST - Request host
  • REQUEST_SCHEME - Request scheme
  • RESPONSE_STATUS_CODE - Response status code
  • RESPONSE_STATUS_TEXT - Response status text
  • API_PROXY_NAME - API Proxy name
  • API_PROXY_ID - API Proxy ID
  • ENDPOINT_NAME - Endpoint name
  • ENDPOINT_ID - Endpoint ID
  • ENVIRONMENT_NAME - Environment name
  • ENVIRONMENT_ID - Environment ID
  • PROJECT_NAME - Project name
  • PROJECT_ID - Project ID
  • USER_NAME - User name
  • USER_ID - User ID
  • ORGANIZATION_NAME - Organization name
  • ORGANIZATION_ID - Organization ID
  • ZONE_ID - Zone ID
  • TIMEZONE_ID - Timezone ID

EnumScriptType​

  • GROOVY - Groovy script
  • JAVASCRIPT - JavaScript script

MapValue​

FieldTypeRequiredDefaultDescription
valuestringYes-Claim value
valueTypestringNoSTRINGValue type. See MapValueType

MapValueType​

  • STRING - String value
  • BOOLEAN - Boolean value
  • INTEGER - Integer value
  • LONG - Long value
  • DOUBLE - Double value
  • FLOAT - Float value
  • STRING_LIST - String list (comma-separated)
  • URI - URI value

Response​

Success Response (200 OK)​

{
"status": "SUCCESS",
"deploymentResult": {
"success": true,
"deploymentResults": [
{
"environmentName": "production",
"success": true,
"message": "Deployment successful"
}
]
}
}

cURL Example​

curl -X POST \
"https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/MyAPI/policies/jose-implementation-policy/" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"operationMetadata": {
"targetScope": "ALL",
"targetPipeline": "RESPONSE",
"deploy": true,
"deployTargetEnvironmentNameList": ["production"],
"order": 1
},
"policy": {
"type": "policy-jose-implementation",
"description": "Generate signed JWT tokens",
"active": true,
"joseTarget": "BODY",
"addIssueTime": true,
"addJWTID": true,
"addIssuer": true,
"issuer": "https://myapi.com",
"addAudience": true,
"audienceList": ["api://myapi"],
"addSubject": true,
"subject": "user123",
"addTypeToHeader": true,
"typeValue": "JWT",
"addExpirationTime": true,
"expirationTimeValue": 3600,
"expirationTimeUnit": "SECONDS",
"sign": true,
"signByIssuer": true,
"encrypt": false
}
}'

Update Policy​

Endpoint​

PUT /apiops/projects/{projectName}/apiProxies/{apiProxyName}/policies/{policyName}/

Request​

Headers​

HeaderValue
AuthorizationBearer {token}
Content-Typeapplication/json

Path Parameters​

ParameterTypeRequiredDescription
projectNamestringYesProject name
apiProxyNamestringYesAPI Proxy name
policyNamestringYesPolicy name

Request Body​

Full JSON Body Example​
{
"operationMetadata": {
"targetScope": "ALL",
"targetPipeline": "RESPONSE",
"deploy": true,
"deployTargetEnvironmentNameList": ["tester"],
"order": 1
},
"policy": {
"type": "policy-jose-implementation",
"description": "Updated: Generate signed JWT tokens with encryption",
"active": true,
"joseTarget": "BODY",
"joseTargetVariable": null,
"jwtClaimsClaim": null,
"escapeJsonString": false,
"addIssueTime": true,
"addJWTID": true,
"addIssuer": true,
"issuer": "https://myapi.com",
"addAudience": true,
"audienceList": ["api://myapi", "api://partners"],
"addSubject": true,
"subject": "user123",
"addTypeToHeader": true,
"typeValue": "JWT",
"addExpirationTime": true,
"expirationTimeValue": 7200,
"expirationTimeUnit": "SECONDS",
"additionalClaimMap": {
"role": {
"value": "admin",
"valueType": "STRING"
},
"permissions": {
"value": "read,write,delete",
"valueType": "STRING_LIST"
},
"department": {
"value": "engineering",
"valueType": "STRING"
}
},
"sign": true,
"signByIssuer": true,
"jwkIdForValidationAndSign": null,
"encrypt": true,
"encryptByIssuer": true,
"jwkIdForDecryptionAndEncryption": null,
"encryptionMethod": "A256GCM",
"encodedClaimsTargetForDataManipulation": "BODY",
"decodedClaimsTargetVariableForDataManipulation": null
}
}

Note: Request body structure is the same as Add Policy. All fields should be provided for update.

Response​

Success Response (200 OK)​

{
"status": "SUCCESS",
"deploymentResult": {
"success": true,
"deploymentResults": [
{
"environmentName": "production",
"success": true,
"message": "Deployment successful"
}
]
}
}

Delete Policy​

Endpoint​

DELETE /apiops/projects/{projectName}/apiProxies/{apiProxyName}/policies/{policyName}/

Request​

Headers​

HeaderValue
AuthorizationBearer {token}
Content-Typeapplication/json

Path Parameters​

ParameterTypeRequiredDescription
projectNamestringYesProject name
apiProxyNamestringYesAPI Proxy name
policyNamestringYesPolicy name

Request Body​

Full JSON Body Example​
{
"operationMetadata": {
"targetScope": "ALL",
"targetPipeline": "RESPONSE",
"deploy": false
}
}

Response​

Success Response (200 OK)​

{
"status": "SUCCESS",
"deploymentResult": {
"success": true,
"deploymentResults": []
}
}

Notes and Warnings​

  • DPoP (RFC 9449) Proof Generation:

    • Sender-constrained token protection: DPoP binds access tokens to the client's cryptographic key, preventing token theft/replay. Proof structure is fixed (htm, htu, iat, jti, typ=dpop+jwt); JWT claim fields are not used when enableDpop: true.
    • Access token hash (ath): Include via dpopAddAth: true (RFC recommends true). Hash is SHA-256 of base64url-encoded token.
    • Asymmetric signing required: signByIssuer: false + jwkIdForValidationAndSign required (RSA/EC/EdDSA only; HMAC rejected).
    • Target URI (htu): Use dpopHtuSource: MANUAL and set dpopHtu explicitly for reverse proxy / TLS termination scenarios. BACKEND_ROUTING_ADDRESS is best-effort; actual backend address may differ under load-balancer failover.
    • Authorization rewrite: Set dpopRewriteAuthorizationScheme: true to change Bearer <token> → DPoP <token> (DPoP-protected servers require DPoP scheme).
    • Nonce (server-provided replay protection): Optional; capture server's DPoP-Nonce response header into a variable, then reference via dpopNonceVariable on next request.
  • JOSE Target:

    • BODY - Token is placed in request/response body
    • AUTHORIZATION_HEADER - Token is placed in Authorization header (standard Bearer token)
    • CHOOSE_FROM_VARIABLE - Token location is dynamic (specified by variable)
    • EMPTY - Token is not placed (for internal use only; used in DPoP proof generation)
  • Standard Claims:

    • iat (Issue Time) - Added when addIssueTime: true
    • jti (JWT ID) - Added when addJWTID: true
    • iss (Issuer) - Added when addIssuer: true (requires issuer)
    • aud (Audience) - Added when addAudience: true (requires audienceList)
    • sub (Subject) - Added when addSubject: true (requires subject)
    • exp (Expiration Time) - Added when addExpirationTime: true (requires expirationTimeValue and expirationTimeUnit)
    • typ - Added to header when addTypeToHeader: true (requires typeValue)
  • Signing:

    • JWT can be signed for integrity and authenticity
    • Signing key can come from issuer credentials or proxy JWK
    • When signByIssuer: false, jwkIdForValidationAndSign is required
  • Encryption:

    • JWT can be encrypted to create JWE (JSON Web Encryption)
    • Encryption method must be specified when encrypt: true
    • Encryption key can come from issuer credentials or proxy JWK
    • When encryptByIssuer: false, jwkIdForDecryptionAndEncryption is required
  • Encryption Methods:

    • A128CBC_HS256, A192CBC_HS384, A256CBC_HS512 - AES-CBC with HMAC (recommended)
    • A128GCM, A192GCM, A256GCM - AES-GCM (recommended for GCM)
    • XC20P - XChaCha20-Poly1305 (modern, secure)
    • Deprecated methods should be avoided
  • Additional Claims:

    • Custom claims can be added via additionalClaimMap
    • Claims support various value types (STRING, BOOLEAN, INTEGER, LONG, DOUBLE, FLOAT, STRING_LIST, URI)
  • Escape JSON String:

    • When escapeJsonString: true, JSON string values are escaped
    • Useful for nested JSON structures
  • Performance: JOSE token generation adds cryptographic processing overhead. Use for necessary security only.

  • Pipeline:

    • REQUEST pipeline generates tokens for outgoing requests
    • RESPONSE pipeline generates tokens for outgoing responses
  • Error Handling: Invalid configuration or JWK failure causes policy to fail

  • Deployment: Policy changes require deployment to take effect. Set deploy: true or deploy manually.