stateless shiro spring boot starter

This project integrates the apache shiro project into a stateless spring boot stater tool project. It improves reuse efficiency, and at the same time it becomes easier to use.

License

License

Categories

Categories

Net
GroupId

GroupId

net.ifok.shiro
ArtifactId

ArtifactId

stateless-shiro-boot-starter
Last Version

Last Version

1.1.1
Release Date

Release Date

Type

Type

jar
Description

Description

stateless shiro spring boot starter
This project integrates the apache shiro project into a stateless spring boot stater tool project. It improves reuse efficiency, and at the same time it becomes easier to use.
Project URL

Project URL

https://github.com/leftso/stateless-shiro-boot-starter
Source Code Management

Source Code Management

https://github.com/leftso/stateless-shiro-boot-starter.git

Download stateless-shiro-boot-starter

How to add to project

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

Dependencies

compile (6)

Group / Artifact Type Version
org.springframework.boot : spring-boot-starter-web jar
org.apache.shiro : shiro-spring jar 1.5.3
com.alibaba : fastjson jar 1.2.73
org.springframework.boot : spring-boot-configuration-processor Optional jar
org.springframework.boot : spring-boot-autoconfigure jar
org.projectlombok : lombok Optional jar

Project Modules

There are no modules declared in this project.

Stateless Apache Shiro Stater

简介

net.ifok.shiro:stateless-shiro-spring-boot-starter项目是整合Apache Shiro 无状态化鉴权成为spring boot的一个starter项目,使用方便。 简单来说就是禁用了session相关鉴权方式,通过token的方式来进行鉴权,适合前后端分离项目,配合net.ifok.swagger:swagger-spring-boot-starter能快速搭建出一个既有鉴权又有Api doc的后台服务。

pom.xml导入maven依赖

        <dependency>
            <groupId>net.ifok.shiro</groupId>
            <artifactId>stateless-shiro-spring-boot-starter</artifactId>
            <version>1.0.0</version>
        </dependency>

实现下面接口

implement net.ifok.project.stateless.shiro.service.StatelessSessionUserService

说明:上方接口用于鉴权的token获取会话对象和创建token等操作用。

Spring Boot 项目application.properties文件配置

# 那些url需要鉴权,默认/** 所有
spring.shiro.stateless.url-patterns=/api/**
# 排除那些不需要拦截的
spring.shiro.stateless.url-excludes=/api/auth/login,/api/auth/logout
# token 名称 默认accessToken,默认从http协议的header获取,如果获取不到则通过参数获取。
spring.shiro.stateless.token-name=token

依赖说明

  • spring-boot-starter-web 2.2.6.RELEASE
  • shiro-spring 1.5.3
  • fastjson 1.2.73

许可说明

Apache Software License, Version 2.0

Versions

Version
1.1.1
1.1.0