·auth
JWT Generator
Payload + secret + algorithm → signed JWT. The reverse of JwtDecoder. HS256/384/512, auto-regenerate on input change, exp/iat/nbf claim helpers.
jwt · jose · hmac · hs256
JwtDecoder reads existing tokens; JwtGenerator produces new ones. For tests, debugging, fixture data — when you need a local token, build it here.
header claims
alg: HS256 · typ: JWT (varsayılan)
secret (HMAC key)
Yaygın örnek secret kullanıyorsun — production'da rastgele üret.
Structure
JWT = base64url(header) + "." + base64url(payload) + "." + base64url(HMAC(header.payload, secret))
On any input change the lab:
- Builds the header with your chosen
alg+typ: "JWT" - Base64url-encodes the payload JSON
- Signs with HMAC via WebCrypto (
crypto.subtle.sign) - Joins the three parts with
.
Claim helpers
+ iat / + exp / + nbf buttons inject Unix timestamps:
iat(issued at) — nowexp(expires at) — now + 1 hournbf(not before) — now
For production JWTs, use jose or jsonwebtoken. This lab is for learning/testing.