jwt

Demo for jwt integration

Лицензия

Лицензия

Категории

Категории

Spring Boot Контейнер Микросервисы
Группа

Группа

com.github.crazyxxl
Идентификатор

Идентификатор

spring-boot-starter-jwt
Последняя версия

Последняя версия

1.0.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

jwt
Demo for jwt integration
Система контроля версий

Система контроля версий

https://github.com/crazyxxl/jwt

Скачать spring-boot-starter-jwt

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.github.crazyxxl/spring-boot-starter-jwt/ -->
<dependency>
    <groupId>com.github.crazyxxl</groupId>
    <artifactId>spring-boot-starter-jwt</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.crazyxxl/spring-boot-starter-jwt/
implementation 'com.github.crazyxxl:spring-boot-starter-jwt:1.0.0'
// https://jarcasting.com/artifacts/com.github.crazyxxl/spring-boot-starter-jwt/
implementation ("com.github.crazyxxl:spring-boot-starter-jwt:1.0.0")
'com.github.crazyxxl:spring-boot-starter-jwt:jar:1.0.0'
<dependency org="com.github.crazyxxl" name="spring-boot-starter-jwt" rev="1.0.0">
  <artifact name="spring-boot-starter-jwt" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.crazyxxl', module='spring-boot-starter-jwt', version='1.0.0')
)
libraryDependencies += "com.github.crazyxxl" % "spring-boot-starter-jwt" % "1.0.0"
[com.github.crazyxxl/spring-boot-starter-jwt "1.0.0"]

Зависимости

compile (4)

Идентификатор библиотеки Тип Версия
org.springframework.boot : spring-boot-starter Необязательный jar
org.springframework.boot : spring-boot-configuration-processor Необязательный jar
io.jsonwebtoken : jjwt jar 0.7.0
commons-codec : commons-codec jar 1.10

provided (3)

Идентификатор библиотеки Тип Версия
javax.servlet : javax.servlet-api jar 3.1.0
javax.servlet.jsp : javax.servlet.jsp-api jar 2.3.1
org.projectlombok : lombok jar 1.16.12

Модули Проекта

Данный проект не имеет модулей.

springboot项目中如何使用该组件

首先添加pom

<dependency>
	<groupId>com.xxl.book</groupId>
	<artifactId>book-demo1</artifactId>
	<version>0.0.1-SNAPSHOT</version>
</dependency>

其次在程序启动处添加注解@JWT

@SpringBootApplication
@JWT
public class BookStart {
	public static void main(String[] args) {
		SpringApplication.run(BookStart.class, args);
	}
}

最后在配置文件添加配置:

##加密秘钥,不可为空
jwt.jwtKey=howsillyyouare
##需要拦截的路径,不可为空
jwt.urlPatterns=/api/v1/content/*
##认证未通过分发路径,不可为空
jwt.authFailPath=/api/v1/Authfail
##请求头起始位置标志,可为空
jwt.headerStartTag=book
##获取用户信息标志,可为空,默认为claims
jwt.claimsInfo

Версии библиотеки

Версия
1.0.0