CAS https方式改简单http方式

一、CAS客户端HTTPSHTTP方式

1.修改所有使用到casclient.jar的项目中该jar包内edu.yale.its.tp.cas.util.SecureURL.class文件(需要进行反编译成java类文件“SecureURL.java),将下边代码中对https访问方式的验证代码注释掉(绿色部分)。

    public static String retrieve(String url) throws IOException {

       if (log.isTraceEnabled())

           log.trace("entering retrieve(" + url + ")");

       BufferedReader r = null;

       String s;

       try {

           URL u = new URL(url);

           /*if (!u.getProtocol().equals("https")) {

              log.error("retrieve(" + url

                     + ") on an illegal URL since protocol was not https.");

              throw new IOException(

                     "only 'https' URLs are valid for this method");

           }*/

           URLConnection uc = u.openConnection();

           uc.setRequestProperty("Connection", "close");

           r = new BufferedReader(new InputStreamReader(uc.getInputStream()));

           StringBuffer buf = new StringBuffer();

           String line;

           while ((line = r.readLine()) != null)

              buf.append(line + "\n");

           s = buf.toString();

       } finally {

           try {

              if (r != null)

                  r.close();

           } catch (IOException ex) {

           }

       }

       return s;

    }

2.修改页面上的https开头的连接,改为http

 修改login.jsp页面内容

 

 

 

修改前:

 

<cas:auth var="netid" scope="session">

<cas:loginUrl>https://passport.com/login</cas:loginUrl>

<cas:validateUrl>https://passport.com/proxyValidate</cas:validateUrl>

</cas:auth>

修改后:

<cas:auth var="netid" scope="session">

<cas:loginUrl>http://passport.com:8080/login</cas:loginUrl>

<cas:validateUrl>http://passport.com:8080/proxyValidate</cas:validateUrl>

</cas:auth>

 修改logout.jsp页面内容

修改前:

<cas:logout

 var="netid"

scope="session" logoutUrl="https://passport.com/logout"/>

修改后:

<cas:logout

 var="netid"

 scope="session" logoutUrl="http://passport.com/logout"/>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值