JWT Generator
Enter a JSON payload and a secret. Signs the token with the secret you type, using the HS256 method only.
Ta treść jest po angielsku.
Use a made-up secret for testing. Anyone who knows the secret can make tokens that look genuine, so do not paste a live production secret into any web page.
Rozwiązane przykłady
A short test token
{"sub":"1"}
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxIn0.vVyZrmccWHSiRiP901TjgbqbAtNpDV_vdEuRvUrV1Yk
The same payload and secret always give this token.
A named user
{"name":"Ann"}
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiQW5uIn0.96KXNqIppO9380Ymo884LLgB6jrHx75_UaRtub5RAvk
Change one letter in the payload and the signature changes completely.
O narzędziu JWT Generator
This generator creates a JSON Web Token signed with HS256. Enter a JSON payload and a secret. Signs the token with the secret you type. Nothing else is needed.
The header is fixed as HS256 and JWT. You can add an expiry, which sets the exp claim, and an issued at time, which sets iat. These tokens suit tests, examples and local development. Anyone who knows the secret can make a token that looks genuine, so use made-up secrets here.
Jak korzystać z narzędzia JWT Generator
- Write the payload as a JSON object.
- Type the secret, and choose an expiry or issued at time if you want them.
- Copy the token.
Typowe zastosowania
- Making a token for a test or a local API
- Producing examples for documentation
- Trying how an application handles an expired token
- Learning how the parts of a token fit together
Najczęstsze pytania
Which signing method is used?
HS256 only, which is HMAC with SHA-256 using a shared secret. Tokens signed with a key pair need a different method.
Will the same inputs give the same token?
Yes, as long as you leave Expires on Never and the issued at box off. The exp and iat claims use the current time, so they change the token.
Should I use a real production secret?
No. Use a made-up secret for tests. A secret you paste into any web page should be treated as one you may need to replace.
How do I read a token?
Use the JWT decoder to see the header and payload, with dates shown as readable times.