You are on page 1of 5

CAS Authentication failed!

PHP notice
Undefined index: SERVER_ADMIN
/var/www/sister/protected/extensions/phpCAS/CAS/AuthenticationException.php(77)
65
66
ver
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89

* @param int
* @param string

$err_code
$err_msg

the error code given by the CAS server


the error message given by the CAS ser

*/
public function __construct($client,$failure,$cas_url,$no_response,
$bad_response='',$cas_response='',$err_code='',$err_msg=''
) {
phpCAS::traceBegin();
$lang = $client->getLangObj();
$client->printHTMLHeader($lang->getAuthenticationFailed());
printf(
$lang->getYouWereNotAuthenticated(),
htmlentities($client->getURL()),
$_SERVER['SERVER_ADMIN']
);
phpCAS::trace('CAS URL: '.$cas_url);
phpCAS::trace('Authentication failure: '.$failure);
if ( $no_response ) {
phpCAS::trace('Reason: no response from the CAS server');
} else {
if ( $bad_response ) {
phpCAS::trace('Reason: bad response from the CAS server');
} else {
switch ($client->getServerVersion()) {
case CAS_VERSION_1_0:
phpCAS::trace('Reason: CAS error');

Stack Trace
#0
/var/www/sister/protected/extensions/phpCAS/CAS/Client.php(2845): CAS_Authentic
ationException->__construct(CAS_Client, "Ticket not validated", "https://sso.une
j.ac.id/cas/serviceValidate?service=https%3A%2F%2...", false, ...)
2840
2841
2842
2843
,
2844
2845
2846
2847
2848
2849
2850

$this, 'Ticket not validated', $validate_url,


false/*$no_response*/, false/*$bad_response*/,
$text_response,
$auth_fail_list->item(0)->getAttribute('code')/*$err_code*/
trim($auth_fail_list->item(0)->nodeValue)/*$err_msg*/
);
$result = false;
} else {
throw new CAS_AuthenticationException(
$this, 'Ticket not validated', $validate_url,
false/*$no_response*/, true/*$bad_response*/,

#1
/var/www/sister/protected/extensions/phpCAS/CAS/Client.php(1224): CAS_Client->v
alidateCAS20("https://sso.unej.ac.id/cas/serviceValidate?service=https%3A%2F%2..
.", " <cas:serviceResponse xmlns:cas='http://www.yale.edu/tp/cas'> ...", DOMElem
ent)

1219
$logoutTicket = $this->getTicket();
1220
break;
1221
case CAS_VERSION_2_0:
1222
// if a Proxy Ticket was given, validate it
1223
phpCAS::trace('CAS 2.0 ticket `'.$this->getTicket().'\'
is present');
1224
$this->validateCAS20($validate_url, $text_response, $tr
ee_response); // note: if it fails, it halts
1225
phpCAS::trace('CAS 2.0 ticket `'.$this->getTicket().'\'
was validated');
1226
if ( $this->isProxy() ) {
1227
$this->_validatePGT($validate_url, $text_response,
$tree_response); // idem
1228
phpCAS::trace('PGT `'.$this->_getPGT().'\' was vali
dated');
1229
$_SESSION['phpCAS']['pgt'] = $this->_getPGT();
#2
/var/www/sister/protected/extensions/phpCAS/CAS/Client.php(1083): CAS_Client->i
sAuthenticated()
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088

*/
public function forceAuthentication()
{
phpCAS::traceBegin();
if ( $this->isAuthenticated() ) {
// the user is authenticated, nothing to be done.
phpCAS::trace('no need to authenticate');
$res = true;
} else {
// the user is not authenticated, redirect to the CAS server

#3
/var/www/sister/protected/extensions/phpCAS/CAS.php(1102): CAS_Client->forceAut
hentication()
1097
phpCAS :: traceBegin();
1098
if (!is_object(self::$_PHPCAS_CLIENT)) {
1099
phpCAS :: error('this method should not be called before ' . __
CLASS__ . '::client() or ' . __CLASS__ . '::proxy()');
1100
}
1101
1102
$auth = self::$_PHPCAS_CLIENT->forceAuthentication();
1103
1104
// store where the authentication has been checked and the result
1105
self::$_PHPCAS_CLIENT->markAuthenticationCall($auth);
1106
1107
/*
if (!$auth) {
#4
/var/www/sister/protected/controllers/SiteController.php(523): phpCAS::forceAut
hentication()
518
519

$this->render('login', array('model' => $model));


}

520
521
522
523
524
525
526
527
528

public function actionLogincas() {


phpCAS::client(CAS_VERSION_2_0, 'sso.unej.ac.id', 443, 'cas');
phpCAS::setNoCasServerValidation();
phpCAS::forceAuthentication();
//new UserIdentity(phpCAS::getUser());
//echo phpCAS::getUser();
$_POST['LoginForm']['username']=phpCAS::getUser();
//$_POST['LoginForm']['password']='MobileUnej!';
$model = new LoginFormcas('login');

#5
/var/www/sister/framework/yiilite.php(3891): SiteController->actionLogincas()
3886
$controller=$this->getController();
3887
$method=new ReflectionMethod($controller, $methodName);
3888
if($method->getNumberOfParameters()>0)
3889
return $this->runWithParamsInternal($controller, $method, $para
ms);
3890
else
3891
return $controller->$methodName();
3892
}
3893 }
3894 class CWebUser extends CApplicationComponent implements IWebUser
3895 {
3896
const FLASH_KEY_PREFIX='Yii.CWebUser.flash.';
#6
/var/www/sister/framework/yiilite.php(3403): CInlineAction->runWithParams(array
("ticket" => "ST-170068-HeeGG3tzqZqe3175YIxy-sso.unej.ac.id"))
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408

{
$priorAction=$this->_action;
$this->_action=$action;
if($this->beforeAction($action))
{
if($action->runWithParams($this->getActionParams())===false)
$this->invalidActionParams($action);
else
$this->afterAction($action);
}
$this->_action=$priorAction;

#7
/var/www/sister/framework/yiilite.php(3388): CController->runAction(CInlineActi
on)
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393

$this->missingAction($actionID);
}
public function runActionWithFilters($action,$filters)
{
if(empty($filters))
$this->runAction($action);
else
{
$priorAction=$this->_action;
$this->_action=$action;
CFilterChain::create($this,$action,$filters)->run();

#8
/var/www/sister/framework/yiilite.php(3378): CController->runActionWithFilters(
CInlineAction, array())
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383

{
if(($parent=$this->getModule())===null)
$parent=Yii::app();
if($parent->beforeControllerAction($this,$action))
{
$this->runActionWithFilters($action,$this->filters());
$parent->afterControllerAction($this,$action);
}
}
else
$this->missingAction($actionID);

#9
/var/www/sister/framework/yiilite.php(1725): CController->run("logincas")
1720
{
1721
list($controller,$actionID)=$ca;
1722
$oldController=$this->_controller;
1723
$this->_controller=$controller;
1724
$controller->init();
1725
$controller->run($actionID);
1726
$this->_controller=$oldController;
1727
}
1728
else
1729
throw new CHttpException(404,Yii::t('yii','Unable to resolve th
e request "{route}".',
1730
array('{route}'=>$route===''?$this->defaultController:$rout
e)));
#10
/var/www/sister/framework/yiilite.php(1645): CWebApplication->runController("si
te/logincas")
1640
)
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650

foreach(array_splice($this->catchAllRequest,1) as $name=>$value
$_GET[$name]=$value;
}
else
$route=$this->getUrlManager()->parseUrl($this->getRequest());
$this->runController($route);
}
protected function registerCoreComponents()
{
parent::registerCoreComponents();
$components=array(

#11
/var/www/sister/framework/yiilite.php(1170): CWebApplication->processRequest()
1165
1166

public function run()


{

1167
1168
1169
1170
1171
1172
1173
1174
1175

if($this->hasEventHandler('onBeginRequest'))
$this->onBeginRequest(new CEvent($this));
register_shutdown_function(array($this,'end'),0,false);
$this->processRequest();
if($this->hasEventHandler('onEndRequest'))
$this->onEndRequest(new CEvent($this));
}
public function end($status=0,$exit=true)
{

#12
/var/www/sister/index.php(14): CApplication->run()
09
10
11
12
13
14

defined('YII_DEBUG') or define('YII_DEBUG',true);
// specify how many levels of call stack should be shown in each log message
//defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
require_once($yii);
Yii::createWebApplication($config)->run();

2014-07-31 18:52:37 Apache/2.2.22 (Unix) DAV/2 PHP/5.3.15 Server Yii Framework/1


.1.13

You might also like