Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hiwepy/security-unionid-spring-boot-starter
security-unionid-spring-boot-starter
https://github.com/hiwepy/security-unionid-spring-boot-starter
Last synced: 24 days ago
JSON representation
security-unionid-spring-boot-starter
- Host: GitHub
- URL: https://github.com/hiwepy/security-unionid-spring-boot-starter
- Owner: hiwepy
- License: apache-2.0
- Created: 2020-08-24T07:24:25.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-03-30T15:30:27.000Z (almost 3 years ago)
- Last Synced: 2023-12-12T10:43:41.505Z (about 1 year ago)
- Language: Java
- Size: 112 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# security-unionid-spring-boot-starter
### 组件简介
> 基于 Security + unionid 的 Spring Boot Starter 实现
主要 扩展Security、unionid 与Spring Boot的整合,实现通过yaml配置即可实现权限拦截扩展,类似Shiro的 shiro.ini 配置方式
### 使用说明
##### 1、Spring Boot 项目添加 Maven 依赖
``` xml
com.github.hiwepy
security-unionid-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]
unionid:
enabled: true
authc:
platform-parameter: platform
unionid-parameter: unionid
token-parameter: token
path-pattern: /login/weixin
post-only: 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)|