jasny / sso

Simple Single Sign-On for PHP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Expected application/json response, got text/html

opened this issue · comments

I had this problem, and I tried to solve it
at @/vendor/jasny/sso/src/Server.php line 311
add
die;

public function userInfo()
{


    $this->startBrokerSession();
    $user = null;

    $username = $this->getSessionData('sso_user');

    if ($username) {
        $user = $this->getUserInfo($username);
        if (!$user) return $this->fail("User not found", 500); // Shouldn't happen
    }
    header('Content-type: application/json; charset=UTF-8');

    echo json_encode($user);
    die;
}

Is there a better way to do it ?

Outputting the user information will be removed in v0.4