key requiredThe secret signing key. The same key must be passed to jwtdecode to verify the token; keep it private. Required - an empty key returns an empty string.
username requiredThe login name to authenticate. Combined with password and checked against the AA permission system (admin users or Reader Management users). Required.
password requiredThe password for username. If the username and password do not authenticate, the command returns an empty string. Required.
lifetime optional default 86400How many seconds the token stays valid, counted from now. Left empty (or 0) it defaults to 86400, one day. The value is stored in the token as the exp (expiry) claim.
add_validity optionalOptional. An AA expression evaluated for the authenticated user (as item:USERID:add_validity) and stored in the token as the aaValid claim. jwtdecode re-evaluates it and rejects the token if the value changed, letting you invalidate old tokens (for example by updating a logout-time field on logout). Works only for Reader Management users; used with a regular admin it returns an empty string.
[{jwtencode:}]
[{jwtencode:my-secret-key}]
[{jwtencode:my-secret-key:editor}]
[{jwtencode:my-secret-key:nosuchuser:wrongpass}]
{jwtencode:my-secret-key:{qss:email}:{qss:password}}
{jwtencode:my-secret-key:{qss:email}:{qss:password}:3600}
{jwtencode:my-secret-key:{qss:email}:{qss:password}:3600:_#EXITTIME}