cas sso 整合 java + php (discuz,bbs) 配備

來源:互聯網
上載者:User
cas sso 整合 java + php (discuz,bbs) 配置

cas 搭建準備工作:

cas-server-3.4.4

cas-client-3.2.0

apache-tomcat-6.0.14

?

去掉https認證,改成http認證

1、進入WEB-INF\spring-configuration目錄
開啟warnCookieGenerator.xml檔案
修改p:cookieSecure的值為false

2、開啟ticketGrantingTicketCookieGenerator.xml檔案
同樣修改p:cookieSecure的值為false

3、開啟WEB-INF\deployerConfigContext.xml檔案
尋找org.jasig.cas.authentication.handler.support.HttpBasedServiceCredentialsAuthenticationHandler
把這代碼塊修改為如下:(添加 p:requireSecure="false"? )


?

java 用戶端配置

        org.jasig.cas.client.session.SingleSignOutHttpSessionListener        CAS Single Sign Out Filter        org.jasig.cas.client.session.SingleSignOutFilter        CAS Single Sign Out Filter        /*        CASFilter        org.jasig.cas.client.authentication.AuthenticationFilter                        casServerLoginUrl                http://116.226.60.173:8888/cas/login                                                serverName                http://116.226.60.173:8888            CASFilter    /front/member/*    CASFilter    /memberCenter/*        CAS Validation Filter                        org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter                        casServerUrlPrefix                http://116.226.60.173:8888/cas                                serverName                http://116.226.60.173:8888              CAS Validation Filter    /*        CAS HttpServletRequest Wrapper Filter                        org.jasig.cas.client.util.HttpServletRequestWrapperFilter        CAS HttpServletRequest Wrapper Filter        /*        CAS Assertion Thread Local Filter        org.jasig.cas.client.util.AssertionThreadLocalFilter        CAS Assertion Thread Local Filter        /*

?

?

?

php 端配置

require_once 'CAS.php';define('CAS_SERVER_HOSTNAME', "192.168.18.8"); define('CAS_SERVER_PORT', 8888); define('CAS_SERVER_APP_NAME', "cas"); phpCAS::setDebug();phpCAS::client(CAS_VERSION_2_0, CAS_SERVER_HOSTNAME, CAS_SERVER_PORT, CAS_SERVER_APP_NAME); phpCAS::setNoCasServerValidation();phpCAS::handleLogoutRequests(); phpCAS::forceAuthentication();$username = phpCAS::getUser(); //擷取cas 服務端使用者名稱?
  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.