-
Notifications
You must be signed in to change notification settings - Fork 169
Description
That message is returned here:
You’ll need to unpack the plugin and do some debugging in this method to see where the issue is occurring. You’ll also need to check your Apache and PHP error logs for any related errors. Looking at the method, if we can’t get the
$staffand$staff->getId();then we return the message so you need to find out why there is no staff. Maybe there is no Email address in the request? Or maybe you can’t create the session?Note:
You will also need to create your own issue report as your report is different than the OP’s (which is OAuth related).Cheers.
Originally posted by @JediKev in #126 (comment)
I've done some digging around by editing the source code on the fly. The original function to trigger a sign in is:
function signOn() {
if (isset($_SESSION[':cas']['user'])) {
$staff = new StaffSession($this->cas->getEmail());
if ($staff && $staff->getId()) {
return $staff;
} else {
$_SESSION['_staff']['auth']['msg'] = 'Have your administrator create a local account';
}
}
}
I've edited it as below in order to get the web app to print details to the browser:
function signOn() {
if (isset($_SESSION[':cas']['user'])) {
$staff = new StaffSession($this->cas->getEmail());
print_r($staff);
die();
if ($staff && $staff->getId()) {
return $staff;
} else {
$_SESSION['_staff']['auth']['msg'] = 'Have your administrator create a local account. ';
echo('PostProcess: ');
print_r($_SESSION[':cas']);
die();
}
}
}
When I try to login using CAS after this modification, I get redirected to my SSO system correctly and I'm able to login. When it redirects back to osTicket, I get the following:
StaffSession Object ( [session] => [token] => [authkey] => [departments] => [stats] => Array ( ) [_extra] => [passwd_change] => [_roles] => [_teams] => [_config] => [_perm] => [ht] => Array ( ) [dirty] => Array ( ) [__new__] => 1 [__deleted__] => [__deferred__] => Array ( ) ) .
It would seem that as no ID is present for getId() to return, the if statement is failing. Either that, or the StaffSession isn't being created at all.
As part of my debugging I added a line to always print $_SESSION[':cas'] to the browser. In this response I get back an array containing a username, email, and name.
Does anyone have any ideas?