========================================================== ========================================================== ======================================
Setp4: bind Tomcat to the cas server: For details, refer to: Baidu, Google, search .....
========================================================== ========================================================== ======================================
1. the PHP client is used for urination, And the PHP client is used for urination. First, download a php client program from the cas download site.
Address:Http://downloads.jasig.org/cas-clients/php/ version a lot, the basic choice of a back, that is, the latest can be!
2. decompress the file to the root directory of your website. Of course, you can also choose another directory. If there is a file named "CAS. php files prove that you downloaded the correct package
3. Create a new file "index. php"
<? Phpinclude_once ('cas. php '); // introduce the cas entry file phpCAS: setDebug (); // set the log: The log will generate a file named "phpCAS" in your program directory. log "log File phpCAS: client (CAS_VERSION_2_0, 'localhost', 8443, 'cas '); // connection/* Note that the localhost here is for your cas server. Because I am on the same computer, it is localhost * 8443: the port * cas set for tomcat for cas: If you configure it according to the previous steps, here is cas */phpCAS: setNoCasServerValidation (); phpCAS: handleLogoutRequests (); // obtain whether the server has exited phpCAS: forceAuthentication (); // verify if (isset ($ _ REQUEST ['Logout']) {phpCAS: logout () ;}?>
4. Open the browser and run: http: // 127.0.0.1/index. php.
If you see this interface, it proves that you can log on to the account normally. | after the password is logged on, it will jump back to 127.0.0.1! We started logging in.
Logon result:
At this time, if we directly log on to the server: the client can see this interface without logon. If we log on to the client, the server will also log on!
But now the problem seems to be above the verification. Single-point login seems to be successful, but once it reaches the php verification stage, it will not be able to pass!
PhpCAS: forceAuthentication (); // the following error is reported during verification: CAS Authentication failed! You were not authenticated. you may submit your request again by clicking here. if the problem persists, you may contact the administrator of this site. phpCAS 1.2.0RC2 using server https: // localhost: 8443/cas/(CAS 2.0)
If you know this question, please leave a message or reply to me. Thank you very much.