This is my phpCAS php file :

index.php
_______________________________________________________________________
<?php

/**
 *   Example for a simple cas 2.0 client
 *
 * PHP Version 5
 *
 * @file     example_simple.php
 * @category Authentication
 * @package  PhpCAS
 * @author   Joachim Fritschi <[email protected]>
 * @author   Adam Franco <[email protected]>
 * @license  http://www.apache.org/licenses/LICENSE-2.0  Apache License 2.0
 * @link     https://wiki.jasig.org/display/CASC/phpCAS
 */

// Load the settings from the central config file
require_once 'config.php';
// Load the CAS lib
require_once $phpcas_path . 'CAS.php';

// Enable debugging
phpCAS::setDebug();

// Initialize phpCAS
phpCAS::client(CAS_VERSION_2_0, '10.0.12.81', 8443, $cas_context);

phpCAS::setExtraCurlOption(CURLOPT_VERBOSE, TRUE);

// For production use set the CA certificate that is the issuer of the cert
// on the CAS server and uncomment the line below
// phpCAS::setCasServerCACert($cas_server_ca_cert_path);

// For quick testing you can disable SSL validation of the CAS server.
// THIS SETTING IS NOT RECOMMENDED FOR PRODUCTION.
// VALIDATING THE CAS SERVER IS CRUCIAL TO THE SECURITY OF THE CAS PROTOCOL!
phpCAS::setNoCasServerValidation();

// force CAS authentication
phpCAS::forceAuthentication();


// at this step, the user has been authenticated by the CAS server
// and the user's login name can be read with phpCAS::getUser().

// logout if desired
if (isset($_REQUEST['logout'])) {
phpCAS::logout();
}

//phpCAS::setDebug('log.txt');

// for this test, simply print that the authentication was successfull
?>
<html>
  <head>
    <title>phpCAS simple client</title>
  </head>
  <body>
    <h1>Successfull Authentication!</h1>
    <?php require 'script_info.php' ?>
     <p>phpCAS version is <b><?php echo phpCAS::getVersion(); ?></b>.</p>
    <p>the user's login is <b><?php echo phpCAS::getUser(); ?></b>.</p>
    <p><a href="?logout=">Logout</a></p>
  
-- 
<BR>
You are currently subscribed to [email protected] as: 
[email protected]
<BR>
To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/cas-user
</BODY>
</html>
__________________________________________________________________________

config.php
__________________________________________________________________________

$phpcas_path = '';

///////////////////////////////////////
// Basic Config of the phpCAS client //
///////////////////////////////////////

// Full Hostname of your CAS Server
$cas_host = '10.0.12.81';

// Context of the CAS Server
$cas_context = '';

// Port of your CAS server. Normally for a https server it's 8443
$cas_port = 8443;

// Path to the ca chain that issued the cas server certificate
$cas_server_ca_cert_path = 'cacert.pem';

//////////////////////////////////////////
// Advanced Config for special purposes //
//////////////////////////////////////////

// The "real" hosts of clustered cas server that send SAML logout messages
// Assumes the cas server is load balanced across multiple hosts
$cas_real_hosts = array('10.0.12.81', '10.0.12.81');

// Client config for cookie hardening
$client_domain = '127.0.0.1';
$client_path = 'phpcas';
$client_secure = true;
$client_httpOnly = true;
$client_lifetime = 0;

// Database config for PGT Storage
$db = 'pgsql:host=localhost;dbname=phpcas';
//$db = 'mysql:host=localhost;dbname=phpcas';
$db_user = 'phpcasuser';
$db_password = 'mysupersecretpass';
$db_table = 'phpcastabel';
$driver_options = '';

///////////////////////////////////////////
// End Configuration -- Don't edit below //
///////////////////////////////////////////

// Generating the URLS for the local cas example services for proxy testing
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
    $curbase = 'https://' . $_SERVER['SERVER_NAME'];
} else {
    $curbase = 'http://' . $_SERVER['SERVER_NAME'];
}
if ($_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 88443) {
    $curbase .= ':' . $_SERVER['SERVER_PORT'];
}

$curdir = dirname($_SERVER['REQUEST_URI']) . "/";

// CAS client nodes for rebroadcasting pgtIou/pgtId and logoutRequest
$rebroadcast_node_1 = '127.0.0.1';
$rebroadcast_node_2 = '127.0.0.1';

// access to a single service
$serviceUrl = $curbase . $curdir . 'example_service.php';
// access to a second service
$serviceUrl2 = $curbase . $curdir . 'example_service_that_proxies.php';

$pgtBase = preg_quote(preg_replace('/^http:/', 'https:', $curbase . 
$curdir), '/');
$pgtUrlRegexp = '/^' . $pgtBase . '.*$/';

$cas_url = 'https://' . $cas_host;
if ($cas_port != '8443') {
    $cas_url = $cas_url . ':' . $cas_port;
}
$cas_url = $cas_url . $cas_context;

// Set the session-name to be unique to the current script so that the 
client script
// doesn't share its session with a proxied script.
// This is just useful when running the example code, but not normally.
session_name(
    'session_for:'
    . preg_replace('/[^a-z0-9-]/i', '_', basename($_SERVER['SCRIPT_NAME']))
);
// Set an UTF-8 encoding header for internation characters (User attributes)
header('Content-Type: text/html; charset=utf-8');
?>
________________________________________________________________________________________


On Wednesday, July 15, 2015 at 1:01:28 AM UTC-7, Andi Zulfadli wrote:
>
>
> Dear Master, 
>
>
> Please your help, I am developing SSO solution by CAS server v4.0.0. 
> backend LDAP server.
>
> but, i got this error when iam running phpCAS client v1.3.3.
>
> i dont know whats wrong about this, please your solution.
>
> thank you very much for your good response.
>
>
> <https://lh3.googleusercontent.com/-_BCEWuAWvuQ/VaYTOpJPOXI/AAAAAAAAAiI/9wEcZEtzum8/s1600/error2.PNG>
>
> Log File :
>
> __________________________________________________________________________________________________________________________________________________
>
>
> E5DE .START phpCAS-1.3.3 ****************** [CAS.php:438]
> E5DE .=> phpCAS::client('2.0', '10.0.12.81', 8443, '') [index.php:26]
> E5DE .|    => CAS_Client::__construct('2.0', false, '10.0.12.81', 8443, 
> '', true) [CAS.php:340]
> E5DE .|    |    Starting a new session pgs43b7b91du7aihq0hn9aim37 
> [Client.php:906]
> E5DE .|    <= ''
> E5DE .<= ''
> E5DE .=> phpCAS::setExtraCurlOtion(41, true) [index.php:28]
> E5DE .<= ''
> E5DE .=> phpCAS::setNoCasServerValidation() [index.php:37]
> E5DE .|    You have configured no validation of the legitimacy of the cas 
> server. This is not recommended for production use. [CAS.php:1553]
> E5DE .<= ''
> E5DE .=> phpCAS::forceAuthentication() [index.php:40]
> E5DE .|    => CAS_Client::forceAuthentication() [CAS.php:1015]
> E5DE .|    |    => CAS_Client::isAuthenticated() [Client.php:1245]
> E5DE .|    |    |    => CAS_Client::_wasPreviouslyAuthenticated() 
> [Client.php:1356]
> E5DE .|    |    |    |    no user found [Client.php:1592]
> E5DE .|    |    |    <= false
> E5DE .|    |    |    no ticket found [Client.php:1453]
> E5DE .|    |    <= false
> E5DE .|    |    => CAS_Client::redirectToCas(false) [Client.php:1254]
> E5DE .|    |    |    => CAS_Client::getServerLoginURL(false, false) 
> [Client.php:1613]
> E5DE .|    |    |    |    => CAS_Client::getURL() [Client.php:342]
> E5DE .|    |    |    |    |    Final URI: http://localhost/demo/ta/cas5/ 
> [Client.php:3466]
> E5DE .|    |    |    |    <= 'http://localhost/demo/ta/cas5/'
> E5DE .|    |    |    <= '
> https://10.0.12.81:8443/login?service=http%3A%2F%2Flocalhost%2Fdemo%2Fta%2Fcas5%2F
> '
> E5DE .|    |    |    Redirect to : 
> https://10.0.12.81:8443/login?service=http%3A%2F%2Flocalhost%2Fdemo%2Fta%2Fcas5%2F
>  
> [Client.php:1620]
> E5DE .|    |    |    exit()
> E5DE .|    |    |    -
> E5DE .|    |    -
> E5DE .|    -
> 44B4 .START phpCAS-1.3.3 ****************** [CAS.php:438]
> 44B4 .=> phpCAS::client('2.0', '10.0.12.81', 8443, '') [index.php:26]
> 44B4 .|    => CAS_Client::__construct('2.0', false, '10.0.12.81', 8443, 
> '', true) [CAS.php:340]
> 44B4 .|    |    Starting a new session pgs43b7b91du7aihq0hn9aim37 
> [Client.php:906]
> 44B4 .|    |    Ticket 'ST-13-W3OmeHczcuhJOGeiwaeO-cas.poliupg.ac.id' 
> found [Client.php:988]
> 44B4 .|    <= ''
> 44B4 .<= ''
> 44B4 .=> phpCAS::setExtraCurlOption(41, true) [index.php:28]
> 44B4 .<= ''
> 44B4 .=> phpCAS::setNoCasServerValidation() [index.php:37]
> 44B4 .|    You have configured no validation of the legitimacy of the cas 
> server. This is not recommended for production use. [CAS.php:1553]
> 44B4 .<= ''
> 44B4 .=> phpCAS::forceAuthentication() [index.php:40]
> 44B4 .|    => CAS_Client::forceAuthentication() [CAS.php:1015]
> 44B4 .|    |    => CAS_Client::isAuthenticated() [Client.php:1245]
> 44B4 .|    |    |    => CAS_Client::_wasPreviouslyAuthenticated() 
> [Client.php:1356]
> 44B4 .|    |    |    |    no user found [Client.php:1592]
> 44B4 .|    |    |    <= false
> 44B4 .|    |    |    CAS 2.0 ticket `
> ST-13-W3OmeHczcuhJOGeiwaeO-cas.poliupg.ac.id' is present [Client.php:1406]
> 44B4 .|    |    |    => CAS_Client::validateCAS20('', NULL, NULL) 
> [Client.php:1409]
> 44B4 .|    |    |    |     [Client.php:3101]
> 44B4 .|    |    |    |    => CAS_Client::getServerServiceValidateURL() 
> [Client.php:3108]
> 44B4 .|    |    |    |    |    => CAS_Client::getURL() [Client.php:453]
> 44B4 .|    |    |    |    |    |    Final URI: 
> http://localhost/demo/ta/cas5/ [Client.php:3466]
> 44B4 .|    |    |    |    |    <= 'http://localhost/demo/ta/cas5/'
> 44B4 .|    |    |    |    <= '
> https://10.0.12.81:8443/serviceValidate?service=http%3A%2F%2Flocalhost%2Fdemo%2Fta%2Fcas5%2F
> '
> 44B4 .|    |    |    |    => CAS_Client::_readURL('
> https://10.0.12.81:8443/serviceValidate?service=http%3A%2F%2Flocalhost%2Fdemo%2Fta%2Fcas5%2F&ticket=ST-13-W3OmeHczcuhJOGeiwaeO-cas.poliupg.ac.id',
>  
> NULL, NULL, NULL) [Client.php:3118]
> 44B4 .|    |    |    |    |    => CAS_Request_CurlRequest::sendRequest() 
> [AbstractRequest.php:242]
> 44B4 .|    |    |    |    |    |    curl_exec() failed [CurlRequest.php:77]
> 44B4 .|    |    |    |    |    <= false
> 44B4 .|    |    |    |    <= false
> 44B4 .|    |    |    |    could not open URL '
> https://10.0.12.81:8443/serviceValidate?service=http%3A%2F%2Flocalhost%2Fdemo%2Fta%2Fcas5%2F&ticket=ST-13-W3OmeHczcuhJOGeiwaeO-cas.poliupg.ac.id'
>  
> to validate (CURL error #35: error:14077438:SSL 
> routines:SSL23_GET_SERVER_HELLO:tlsv1 alert internal error) 
> [Client.php:3121]
> 44B4 .|    |    |    |    => 
> CAS_AuthenticationException::__construct(CAS_Client, 'Ticket not 
> validated', '
> https://10.0.12.81:8443/serviceValidate?service=http%3A%2F%2Flocalhost%2Fdemo%2Fta%2Fcas5%2F&ticket=ST-13-W3OmeHczcuhJOGeiwaeO-cas.poliupg.ac.id',
>  
> true) [Client.php:3125]
> 44B4 .|    |    |    |    |    => CAS_Client::getURL() 
> [AuthenticationException.php:76]
> 44B4 .|    |    |    |    |    <= 'http://localhost/demo/ta/cas5/'
> 44B4 .|    |    |    |    |    CAS URL: 
> https://10.0.12.81:8443/serviceValidate?service=http%3A%2F%2Flocalhost%2Fdemo%2Fta%2Fcas5%2F&ticket=ST-13-W3OmeHczcuhJOGeiwaeO-cas.poliupg.ac.id
>  
> [AuthenticationException.php:79]
> 44B4 .|    |    |    |    |    Authentication failure: Ticket not 
> validated [AuthenticationException.php:80]
> 44B4 .|    |    |    |    |    Reason: no response from the CAS server 
> [AuthenticationException.php:82]
> 44B4 .|    |    |    |    |    exit()
> 44B4 .|    |    |    |    |    -
> 44B4 .|    |    |    |    -
> 44B4 .|    |    |    -
> 44B4 .|    |    -
> 44B4 .|    -
>
>
> _________________________________________________________________________________________________________________________________________________
>
>

Reply via email to