Signs the request or response body as a JWT, replacing the body with the compact JWS serialization (or storing it in a property instead, when
property is set). The body must be a JSON object;
iat,
exp and
nbf claims are added automatically before signing.
See tutorials/jwt/20-JWT-Signing.yaml .
Example Configuration Copy api : port : 2000 flow : - template : contentType : application/json src : | { "sub": "alice", "aud": "demo-resource" } - jwtSign : property : token jwk : location : jwk.json
api:
port: 2000
flow:
- template:
contentType: application/json
src: |
{
"sub": "alice",
"aud": "demo-resource"
}
- jwtSign:
property: token
jwk:
location: jwk.json
Syntax Copy jwtSign : clockSkewSeconds : <int> expirySeconds : <int> jwk : { } property : <string>
jwtSign:
clockSkewSeconds: <int>
expirySeconds: <int>
jwk: {}
property: <string>
Attributes Name Required Default Description Examples clockSkewSeconds false 120 To account for clock skew between systems, the token's validity start (the nbf claim) is backdated from "issued at" by this many seconds. - expirySeconds false 300 Time in seconds after which the signed token expires (used to compute the exp claim). - property false - Name of an exchange property to receive the signed JWT instead of replacing the message body. -
Child Structure Element Cardinality Description jwk 0..1 The RSA key used to sign the JWT.
Can be used in