Code Monkey home page Code Monkey logo

shiro-pac4j-spring-boot-starter's Introduction

shiro-pac4j-spring-boot-starter

说明

基于开源项目 buji-pac4j + pac4j 实现的Shiro单点登录 Spring Boot Starter 实现

  1. Apache Shiro是一个强大且易用的Java安全框架,执行身份验证、授权、密码学和会话管理。使用Shiro的易于理解的API,您可以快速、轻松地获得任何应用程序,从最小的移动应用程序到最大的网络和企业应用程序。
  2. shiro-pac4j-spring-boot-starter 是在引用 shiro-spring-boot-startershiro-spring-boot-web-startershiro-biz-spring-boot-starter 的基础上整合 pac4j 的 Spring Boot 整合;
  3. 整合 Pac4j 实现与Cas认证的对接,借助Pac4j已有的丰富认证协议实现,可使我们的程序具备多种认证协议的支持能力,可在后期很方便的对接其他认证协议;如 OAuth2、OpenID 等

Maven

<dependency>
	<groupId>com.github.hiwepy</groupId>
	<artifactId>shiro-pac4j-spring-boot-starter</artifactId>
	<version>${project.version}</version>
</dependency>

配置参考

application.yml

################################################################################################################  
###Shiro 权限控制基本配置:  
################################################################################################################
shiro:
  enabled: true
  validate-captcha: false
  login-url: /authz/login
  redirect-url: /authz/index
  success-url: /index
  unauthorized-url: /error
  failure-url: /error
  annotations: 
    enabled: true
  web: 
    enabled: true
  filter-chain-definition-map: 
    / : anon
    /*favicon.ico : anon
    /webjars/** : anon
    /assets/** : anon
    /html/** : anon
    /error* : anon
    /logo/** : anon
    /kaptcha* : anon
    /sockets/** : anon
    /logout : logout
    /callback : cas
    /index : sessionExpired,sessionControl,authc
    /** : sessionExpired,sessionControl,authc
  pac4j:
    cas:
      accept-any-proxy: true
      authorizers: securityheaders, cas
      enabled: true
      encoding: UTF-8
      cas-client-name: cas
      cas-server-login-url: http://127.0.0.1:10000/cas/login
      cas-server-logout-url: http://127.0.0.1:10000/cas/logout
      cas-server-url-prefix: http://127.0.0.1:10000/cas
      client-name: cas
      server-callback-url: /callback
      server-name: http://127.0.0.1:8080

参考资料

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

http://www.pac4j.org/

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

http://blog.csdn.net/change_on/article/details/76302161

http://blog.csdn.net/ywslakers123/article/details/78288112

Jeebiz 技术社区

Jeebiz 技术社区 微信公共号小程序,欢迎关注反馈意见和一起交流,关注公众号回复「Jeebiz」拉你入群。

公共号 小程序

shiro-pac4j-spring-boot-starter's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

shiro-pac4j-spring-boot-starter's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.