Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hiwepy/security-qrcode-spring-boot-starter
Spring Security 整合 扫码登录
https://github.com/hiwepy/security-qrcode-spring-boot-starter
Last synced: 6 days ago
JSON representation
Spring Security 整合 扫码登录
- Host: GitHub
- URL: https://github.com/hiwepy/security-qrcode-spring-boot-starter
- Owner: hiwepy
- License: apache-2.0
- Created: 2019-09-04T13:53:14.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-09-17T13:02:40.000Z (3 months ago)
- Last Synced: 2024-09-17T16:16:01.663Z (3 months ago)
- Language: Java
- Size: 199 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# security-qrcode-spring-boot-starter
### 组件简介
> 基于 Security + Pac4j 的 Spring Boot Starter 实现
主要 扩展Security、Zxing 与Spring Boot的整合,实现通过yaml配置即可实现权限拦截扩展,类似Shiro的 shiro.ini 配置方式
### 使用说明
##### 1、Spring Boot 项目添加 Maven 依赖
``` xml
com.github.hiwepy
security-qrcode-spring-boot-starter
${project.version}```
##### 2、在`application.yml`文件中增加如下配置
```yaml
spring:
# Spring Security 配置
security:
# 默认路径拦截规则定义
filter-chain-definition-map:
'[/]' : anon
'[/**/favicon.ico]' : anon
'[/webjars/**]': anon
'[/assets/**]' : anon
'[/error*]' : anon
'[/logo/**]' : anon
'[/swagger-ui.html**]' : anon
'[/swagger-resources/**]' : anon
'[/doc.html**]' : anon
'[/bycdao-ui/**]' : anon
'[/v2/**]' : anon
'[/kaptcha*]' : anon
'[/actuator*]' : anon
'[/actuator/**]' : anon
'[/druid/*]' : ipaddr[192.168.1.0/24]
'[/monitoring]' : roles[admin]
'[/monitoring2]' : roles[1,admin]
'[/monitoring3]' : perms[1,admin]
'[/monitoring4]' : perms[1]
# 扫码登录
qrcode:
enabled: true
```##### 3、使用示例
```java
SecurityPrincipal principal = SubjectUtils.getPrincipal(SecurityPrincipal.class);
```## Jeebiz 技术社区
Jeebiz 技术社区 **微信公共号**、**小程序**,欢迎关注反馈意见和一起交流,关注公众号回复「Jeebiz」拉你入群。
|公共号|小程序|
|---|---|
| ![](https://raw.githubusercontent.com/hiwepy/static/main/images/qrcode_for_gh_1d965ea2dfd1_344.jpg)| ![](https://raw.githubusercontent.com/hiwepy/static/main/images/gh_09d7d00da63e_344.jpg)|