Docs/Security Utils/GET /v1/jwt-encode

GET /v1/jwt-encodeJWT encode — create signed JWT

Security Utils lf-security-utils

Packs some data into a signed token that the other side can check for tampering. Creates a signed JWT token with HS256/HS384/HS512 algorithms from a JSON payload and secret.

Query Parameters

ParameterTypeRequiredDescription
payloadstringYesJSON string payload
secretstringYesSecret key for signing
algorithmstringNoHS256/HS384/HS512
expires_inintegerNoExpiry in seconds

Response Schema

success (boolean): Operation success
token (string): Signed JWT token
algorithm (string): Algorithm used
expires_at (integer): Expiry timestamp

cURL Example

curl 'https://lf-security-utils.laminarforge.dev/v1/jwt-encode?payload=%7B%22sub%22:%22123%22%7D&secret=mysecret' -H 'Authorization: Bearer lf_YourApiKey'

Python Example

import requests
url = 'https://lf-security-utils.laminarforge.dev/v1/jwt-encode'
headers = {'Authorization': 'Bearer lf_YourApiKey'}
params = {'payload': '{"sub":"123"}', 'secret': 'mysecret'}
response = requests.get(url, headers=headers, params=params)
print(response.json())