I try to get OpenID Steamauthentification working in my cakePHP3 app using this as my source: https://github.com/SmItH197/SteamAuthentication
I made a new Authenticate Component and it works fine but i had to add some lines of code (marked with //+) which just dont make sense in my view:
public function authenticate(Request $request, Response $response)
{
$openid = new \LightOpenID($steamauth['domainname']);
debug($openid);//+
if (!$openid->mode) {
$openid->identity = 'http://steamcommunity.com/openid';
header('Location: ' . $openid->authUrl());
$openid->authUrl();//+
debug($openid);//+
} elseif ($openid->mode == 'cancel') {
echo 'User has canceled authentication!';
} else {
if ($openid->validate()) {
$id = $openid->identity;
$ptn = "/^http:\/\/steamcommunity\.com\/openid\/id\/(7[0-9]{15,25}+)$/";
preg_match($ptn, $id, $matches);
debug($matches[1]);// steam id
return $matches;
} else {
return false;
}
}
return false;
}
So without those 3 lines it doesnt work. debug is returning the variable itself and authUrl() is returning an Url String. Does anyone have an idea why i have to return the variables to get this running? Could this be a PHP7 issue?
The appropriate method can be found in the githubrep file steamauth.php.