项目作者: hiwepy

项目描述 :
shiro-biz-spring-boot-starter
高级语言: Java
项目地址: git://github.com/hiwepy/shiro-biz-spring-boot-starter.git
创建时间: 2017-09-13T12:09:25Z
项目社区:https://github.com/hiwepy/shiro-biz-spring-boot-starter

开源协议:Apache License 2.0

下载


shiro-biz-spring-boot-starter

shiro starter for spring boot

说明

基于 Shiro 的 Spring Boot Starter 实现

  1. Apache Shiro是一个强大且易用的Java安全框架,执行身份验证、授权、密码学和会话管理。使用Shiro的易于理解的API,您可以快速、轻松地获得任何应用程序,从最小的移动应用程序到最大的网络和企业应用程序。
  2. shiro-biz-spring-boot-starter 是在引用 shiro-spring-boot-startershiro-spring-boot-web-starter 的基础上整合 shiro-biz 的 Spring Boot 整合;
  3. 完成了基于Shiro的权限的控制

Maven

  1. <dependency>
  2. <groupId>com.github.hiwepy</groupId>
  3. <artifactId>shiro-biz-spring-boot-starter</artifactId>
  4. <version>${project.version}</version>
  5. </dependency>

配置参考

application.yml

  1. ################################################################################################################
  2. ###Shiro 权限控制基本配置:
  3. ################################################################################################################
  4. shiro:
  5. annotations:
  6. enabled: true
  7. proxy-target-class: true
  8. authentication-caching-enabled: false
  9. authentication-cache-name: SHIRO-AUTHC
  10. authorization-caching-enabled: false
  11. authorization-cache-name: SHIRO-AUTHZ
  12. caching-enabled: false
  13. cache:
  14. type: ehcache
  15. enabled: true
  16. kaptcha:
  17. enabled: true
  18. retry-times-when-access-denied: 3
  19. failure-url: /error
  20. http:
  21. header:
  22. access-control-allow-methods: PUT,POST,GET,DELETE,OPTIONS
  23. jwt:
  24. enabled: true
  25. login-url: /authz/login/slogin
  26. redirect-url: /authz/login/index
  27. success-url: /index
  28. session-creation-enabled: false
  29. session-validation-scheduler-enabled: false
  30. session-validation-interval: 20000
  31. session-stateless: true
  32. session-storage-enabled: false
  33. session-timeout: 1800000
  34. unauthorized-url: /error
  35. user-native-session-manager: false
  36. web:
  37. enabled: true
  38. filter-chain-definition-map:
  39. '[/]' : anon
  40. '[/**/favicon.ico]' : anon
  41. '[/webjars/**]' : anon
  42. '[/assets/**]' : anon
  43. '[/error*]' : anon
  44. '[/logo/**]' : anon
  45. '[/swagger-ui.html**]' : anon
  46. '[/swagger-resources/**]' : anon
  47. '[/v2/**]' : anon
  48. '[/kaptcha*]' : anon
  49. '[/admin]' : anon
  50. '[/admin/assets/**]' : anon
  51. '[/admin/applications]' : anon
  52. '[/admin/applications/**]' : anon
  53. '[/admin/notifications]' : anon
  54. '[/admin/notifications/**]' : anon
  55. '[/admin/instances]' : anon
  56. '[/admin/instances/**]' : anon
  57. '[/sockets/**]' : anon
  58. '[/expiry]' : cros,withinExpiry
  59. '[/authz/login/slogin]' : cros,authc
  60. '[/logout]' : logout

Sample

https://github.com/vindell/spring-boot-starter-samples/tree/master/spring-boot-sample-shiro-biz

参考资料

http://shiro.apache.org/documentation.html

http://jinnianshilongnian.iteye.com/blog/2018398