https://github.com/trendyol/jwt-generator
https://github.com/trendyol/jwt-generator
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/trendyol/jwt-generator
- Owner: Trendyol
- License: gpl-3.0
- Created: 2019-08-23T15:49:24.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2025-02-03T11:15:59.000Z (11 months ago)
- Last Synced: 2025-03-22T05:33:01.547Z (10 months ago)
- Language: Java
- Size: 28.3 KB
- Stars: 4
- Watchers: 9
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# JWT-Generator
## Description
This repository contains a JWT generator using [JJWT](https://github.com/jwtk/jjwt).
## Usage
In order to use the generator, a secret and a body must be provided, several fields for header can be also be provided.
In order to provide fields for header, you must create a Map that contains the fields you want. If there is no fields you want to add to header section of the JWT, you can assign null to the header.
In order to provide a body, you can either provide an ```Object``` that contains fields which you want in the body, or you can create a ```Map```.
Once you get a secret, header and a body, you can call:
```java
String jwt = JWTGenerator.getJWT(secret, header, body);
```
By doing this, you should have obtained JWT successfully.
## Examples
In order to see example codes, go to [```src/main/java/com/trendyol/jwt/example```](src/main/java/com/trendyol/jwt/example) directory.