Files
onixbyte-bom/simple-jwt-jjwt
Zihlu Wang 02c8d2ab29 Merge remote-tracking branch 'origin/dev/v1.1.2' into dev/v1.2.0
# Conflicts:
#	devkit-core/pom.xml
#	devkit-utils/pom.xml
#	guid/pom.xml
#	pom.xml
#	property-guard-spring-boot-starter/pom.xml
#	simple-jwt-authzero/pom.xml
#	simple-jwt-facade/pom.xml
#	simple-jwt-jjwt/pom.xml
#	simple-jwt-spring-boot-starter/pom.xml
#	webcal/pom.xml
2023-10-17 12:50:13 +08:00
..
2023-10-17 11:07:25 +08:00

Module simple-jwt-jjwt

Introduction

The simple-jwt-jjwt module is an implementation of module simple-jwt-facade which uses the third-party library io.jsonwebtoken:jjwt-api. By using this module can help you use JWT to help you in your application.

Prerequisites

This whole JDevKit is developed by JDK 17, which means you have to use JDK 17 for better experience.

Installation

This module has already imported simple-jwt-facade, there is no need to import it again.

If you are using Maven

It is quite simple to install this module by Maven. The only thing you need to do is find your pom.xml file in the project, then find the <dependencies> node in the <project> node, and add the following codes to <dependencies> node:

<dependency>
	<groupId>cn.org.codecrafters</groupId>
    <artifactId>simple-jwt-jjwt</artifactId>
    <version>${simple-jwt-jjwt.version}</version>
</dependency>

And run mvn dependency:get in your project root folder(i.e., if your pom.xml is located at /path/to/your/project/pom.xml, then your current work folder should be /path/to/your/project), then Maven will automatically download the jar archive from Maven Central Repository. This could be MUCH EASIER if you are using IDE(i.e., IntelliJ IDEA), the only thing you need to do is click the refresh button of Maven.

If you are using Gradle

Add this module to your project with Gradle is much easier than doing so with Maven.

Find build.gradle in the needed project, and add the following code to the dependencies closure in the build script:

implementation 'cn.org.codecrafters:simple-jwt-authzero:${simple-jwt-authzero.version}'

If you are not using Maven or Gradle

  1. Download the jar file from the Internet.
  2. Create a folder in your project and name it as a name you like(i.e., for me, I prefer vendor).
  3. Put the jar file to the folder you just created in Step 2.
  4. Add this folder to your project classpath.

Use the JjwtTokenResolver

We have implemented TokenResolver to make sure you can add JWT to your Java application as soon as possible. All you need to do is to create an instance of cn.org.codecrafters.simplejwt.jjwt.JjwtTokenResolver and other operations to JWT could follow our instruction in simple-jwt-facade.

Contact

If you have any suggestions, ideas, don't hesitate contacting us via GitHub Issues or Discord Community.

If you face any bugs while using our library and you are able to fix any bugs in our library, we would be happy to accept pull requests from you on GitHub.