Skip to content

Simple lightweight Jwt library for java. While jjwt is too complex

Notifications You must be signed in to change notification settings

lehoai/SimpleJwt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SimpleJwt - A Lightweight Alternative to JJWT for Simple JWT Needs

SimpleJwt is a minimalistic library for creating, verifying, and decoding JSON Web Tokens (JWT) in Java, specifically using the HS256 (HMAC-SHA256) algorithm. If you find JJWT or other JWT libraries overly complex for your needs, SimpleJwt provides a straightforward solution for essential JWT functionality. This project is ideal for developers who need a simple way to manage JWTs in Java without any extra dependencies.

Features

  • Lightweight: Avoids the complexity of larger libraries like JJWT.
  • Essential Functionality: Supports token creation, verification, and payload decoding with HS256, a widely-used symmetric signing algorithm.
  • Ease of Use: Simple, easy-to-use methods for handling JWTs.

Usage

Generate JWT

SimpleJwt.JwtBuilder jwtBuilder = new SimpleJwt.JwtBuilder();
String jwt = jwtBuilder.generateJwt("myemail@gmail.com", "thisismyverylongkey", 1000); // time in seconds

Verify and get payload

SimpleJwt.JwtParser jwtParser = new SimpleJwt.JwtParser();
jwtParser.verifyToken(jwt, "thisismyverylongkey")
jwtParser.getPayload(jwt)

License

MIT

About

Simple lightweight Jwt library for java. While jjwt is too complex

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages