zoukankan      html  css  js  c++  java
  • cas 服务端相关配置

    SSO-安全证书配置

      CAS默认使用的是HTTPS协议,如果对安全要求不高,可以使用HTTP协议
      修改deployerConfigContext.xml(cas/WEB-INF)增加参数 p:requireSecure="false",是否需要安全验证,即HTTP,false表示不采用。
      <bean
       class="org.jasig.cas.authentication.handler.support.HttpBasedServiceCredentialsAuthenticationHandler" 
       p:httpClient-ref="httpClient"   
       p:requireSecure="false" />  
     
     修改ticketGrantingTicketCookieGenerator.xml(cas/WEB-INF/spring-configuration/ticketGrantingTicketCookieGenerator.xml)
     中ticketGrantingTicketCookieGenerator p:cookieSecure 属性修改为false.  
     <bean id="ticketGrantingTicketCookieGenerator"  
           class="org.jasig.cas.web.support.CookieRetrievingCookieGenerator"  
           p:cookieSecure="false"
           p:cookieMaxAge="-1"
           p:cookieName="CASTGC"
           p:cookiePath="/cas" />  
      
    

    配置转换器返回更多用户信息

    从cas server登录成功后,默认只能从cas server得到用户名,但程序中也可能遇到需要得到更多如姓名,手机号,email等更多用户信息的情况
    

    客户端配置支持http协议

      CAS 默认使用的是HTTPS协议,如果对安全要求不高,可以使用HTTP协议
      修改deployerConfigContext.xml(cas/WEB-INF)增加参数 p:requireSecure="false",是否需要安全验证,即HTTPS,false表示不采用
      <bean 
       class="org.jasig.cas.authentication.handler.support.HttpBasedServiceCredentialsAuthenticationHandler" 
       p:httpClient-ref="httpClient"   
       p:requireSecure="false" />  
    
      cas.warWEB-INFclassesservicesHTTPSandIMAPS-10000001.json
      "serviceId" : "^(https|imaps|http)://.*",
       "name" : "HTTPS and IMAPS and HTTP",      
     
      修改ticketGrantingTicketCookieGenerator.xml(cas/WEB-INF/spring-configutration/ticketGrantingCookieGenerator.xml)
      中ticketGrantingTicketCookieGenerator p:cookieSecure 属性修改为false 
      <bean id="ticketGrantingTicketCookieGenerator" class="org.jasig.cas.web.support.CookieRetrievingCookieGenerator"
        p:cookieSecure="false"
        p:cookieMaxAge="-1"
        p:cookieName="CASTGC"
        p:cookiePath="/cas" />
      将参数p:cookieSecure="true" 改为p:cookieSecure="false",同理为https验证相关,TURE为采用HTTPS验证与deployerConfigContext.xml参数保持一致
    参数p:cookieMaxAge="-1",简单的说是COOKIE的最大生命周期,-1为无生命周期,即只在当前打开的IE窗口有效,IE关闭或重新打开其他窗口,仍会要求验证。
    可以根据需要修改为大于0的数字,比如3600等,意思是在3600秒内,打开任意IE窗口,都不需要验证
    
    
  • 相关阅读:
    Bug测试报告--在线考试系统--金州勇士
    Bug测试报告--食物链教学工具--奋斗吧兄弟
    Jquery对象和dom对象获取html的方法
    mysql中常见的存储引擎和索引类型
    转:spring MVC HTTP406 Not Acceptable
    Mybatis动态建表
    ssm框架插入mysql数据库中文乱码问题解决
    Maven环境下Poi的使用
    【转】Mybatis传多个参数(三种解决方案)
    【译文】用Spring Cloud和Docker搭建微服务平台
  • 原文地址:https://www.cnblogs.com/ssgao/p/8817000.html
Copyright © 2011-2022 走看看