没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论




















spring boot整合整合CAS Client实现单点登陆验证的示例实现单点登陆验证的示例
本篇文章主要介绍了spring boot整合CAS Client实现单点登陆验证的示例,小编觉得挺不错的,现在分享给大家,也给
大家做个参考。一起跟随小编过来看看吧
本文介绍了spring boot整合CAS Client实现单点登陆验证的示例,分享给大家,也给自己留个笔记,具体如下:
单点登录( Single Sign-On , 简称 SSO )是目前比较流行的服务于企业业务整合的解决方案之一, SSO 使得在多个应用系统中,用
户只需要 登录一次 就可以访问所有相互信任的应用系统。
CAS Client
负责处理对客户端受保护资源的访问请求,需要对请求方进行身份认证时,重定向到 CAS Server 进行认证。(原则上,客户端应用不
再接受任何的用户名密码等 Credentials )。
实现方式一:使用第三方的实现方式一:使用第三方的starter
1、依赖的jar
<dependency>
<groupId>net.unicon.cas</groupId>
<artifactId>cas-client-autoconfig-support</artifactId>
<version>1.4.0-GA</version>
</dependency>
2、增加配置文件
cas.server-url-prefix=http://127.0.0.1
cas.server-login-url=http://127.0.0.1/login
cas.client-host-url=http://192.26.4.28:8080
cas.validation-type=CAS
3、开启CAS Client支持
@SpringBootApplication
@ComponentScan(basePackages={"com.chhliu.emailservice"})
@EnableCasClient // 开启CAS支持
public class Application extends SpringBootServletInitializer{
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
通过上面的3步,就可以完成CAS的客户端认证了!
4、扩展
cas.validation-type目前支持3中方式:1、CAS;2、CAS3;3、SAML
其他可用的配置如下:
cas.authentication-url-patterns
cas.validation-url-patterns
cas.request-wrapper-url-patterns
cas.assertion-thread-local-url-patterns
cas.gateway
cas.use-session
cas.redirect-after-validation
cas.allowed-proxy-chains
cas.proxy-callback-url
cas.proxy-receptor-url
cas.accept-any-proxy
server.context-parameters.renew
具体的含义从名字上就可以很清楚的看出来。
实现方式二:手动配置实现方式二:手动配置
我们原来使用CAS Client,需要在web.xml中做如下配置:
<filter>
<filter-name>authenticationFilter</filter-name>
<filter-class>org.jasig.cas.client.authentication.AuthenticationFilter</filter-class>
<init-param>
<param-name>casServerLoginUrl</param-name>
<param-value>http://127.0.0.1/login</param-value>
</init-param>
<init-param>
<param-name>serverName</param-name>
资源评论


weixin_38608693
- 粉丝: 2
- 资源: 907
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助


安全验证
文档复制为VIP权益,开通VIP直接复制
