CAS overlay template 4.2.7 获取除用户名外其他信息遇到的问题

CAS服务端配置了mysql 用户名密码验证,去掉了https校验。

客户端端通过配置web.xml相关filter。其中注意,我配置了

Cas20ProxyReceivingTicketValidationFilter

客户端是通过
cas-client-core-3.4.1.jar!CommonUtils的
getResponseFromServer(URL constructedUrl, HttpURLConnectionFactory factory, String encoding)

方法获取服务端返回的流信息,但是问题是始终返回不了其他用户属性信息。


我也是抱着试一试的态度,把

Cas20ProxyReceivingTicketValidationFilter

换成了

Cas30ProxyReceivingTicketValidationFilter

,测试成功,返回了相关用户信息。

这里记录一下,目前

Cas20ProxyReceivingTicketValidationFilter为什么没有获取到额外用户信息,没有找到原因。先用着,没有时间去一行行找问题了。

后面看源码发现,


protected void prepareMergedOutputModel(Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) throws Exception {
        super.prepareMergedOutputModel(model, request, response);
        Service service = super.getServiceFrom(model);
        RegisteredService registeredService = this.servicesManager.findServiceBy(service);
        Map<String, Object> attributes = new HashMap(this.getPrincipalAttributesAsMultiValuedAttributes(model));
        attributes.put("authenticationDate", Collections.singleton(this.getAuthenticationDate(model)));
        attributes.put("isFromNewLogin", Collections.singleton(Boolean.valueOf(this.isAssertionBackedByNewLogin(model))));
        attributes.put("longTermAuthenticationRequestTokenUsed", Collections.singleton(Boolean.valueOf(this.isRememberMeAuthentication(model))));
        this.decideIfCredentialPasswordShouldBeReleasedAsAttribute(attributes, model, registeredService);
        this.decideIfProxyGrantingTicketShouldBeReleasedAsAttribute(attributes, model, registeredService);
        super.putIntoModel(model, "attributes", this.casAttributeEncoder.encodeAttributes(attributes, this.getServiceFrom(model)));
    }

大概问题就在这里了。



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

java技术之路

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值