Skip to content
Testaroo
jwt354 B

Sample JWT (HS256)

A sample JSON Web Token (JWT) signed with HS256 using a published example secret (verifiable but powerless) for testing JWT decoders and validators. Sample only, never for production. Paired with its decoded claims.

Preview, first 2 linesjwt
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJzYW1wbGUtdXNlci0wMSIsIm5hbWUiOiJFeGFtcGxlIFVzZXIiLCJyb2xlIjoiZGVtbyIsImlzcyI6Im5vdnVzLWV4YW1wbGVzIiwiaWF0IjoxNzY3MjI1NjAwLCJleHAiOjE3OTg3NjE2MDAsIm5vdGUiOiJTQU1QTEUgVE9LRU4gXHUyMDE0IHNpZ25lZCB3aXRoIGEgcHVibGljIGV4YW1wbGUgc2VjcmV0LiBOb3QgZm9yIHByb2R1Y3Rpb24uIn0.ase-yAnjHYb-YvndC3eORYxgjr2X1Xn83dH04Po6P38

Specifications

Format
JSON Web Token
Algorithm
HS256
Claims
sub, name, role, iss, iat, exp
Label
SAMPLE ONLY: public secret, not for production

Testing contract

Expected to pass
Scenario
Exercise Sample JWT (HS256) in its security workflow. A sample JSON Web Token (JWT) signed with HS256 using a published example secret (verifiable but powerless) for testing JWT decoders and validators.
Expected result
1 text lines, decoded as UTF-8; first nonempty line is 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJzYW1wbGUtdXNlci0wMSIsIm5hbWUiOiJFeGFtcGxlIFVzZXIiLCJyb2xlIjoiZGVtbyIsImlzcyI6Im5vdnVzLWV4YW…'. Declared feature checks: algorithm=HS256; claims=sub, name, role, iss, iat, exp; label=SAMPLE ONLY, public secret, not for production. The declared comparison counterpart is data-jwt-decoded; preserve the stated difference instead of expecting the container bytes to match.

What is a .jwt file?

A JWT (JSON Web Token) is a compact, URL-safe token made of three base64url-encoded parts (a header, a payload of claims, and a signature) separated by dots. It is widely used to carry authentication and authorisation claims between services.

How to use this file

Use a sample JWT to test token decoding, claim extraction, and signature verification. Never use an example token's secret in production.

How to use this file for testing

“Sample JWT (HS256)” is a deterministic Testaroo fixture for Conversion testing, Editor testing. The same content exported across many formats and linked as a group, so you can convert one and diff against the expected twin.

Documented properties for this file: HS256 · JSON Web Token. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.

Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such, expect parsers to fail loudly rather than silently accept them.

Data fixtures document their exact quirks (delimiters, encodings, null handling, schema, and row counts) in the spec table. Point your parser or importer at the file and assert it handles the documented edge cases; clean and deliberately-messy siblings make before/after diffs straightforward.

Code examples

cut -d. -f1 sample.jwt | base64 -d; echo
cut -d. -f2 sample.jwt | base64 -d; echo    # payload claims

Generated by generation/q8_extras.py. Free for any use, no attribution required, license.