Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion example/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
}
],
"require": {
"php": ">=8.5",
"php": ">=8.1",
"web-eid/web-eid-authtoken-validation-php": "1.3.*",
"altorouter/altorouter": "^2.0.3",
"psr/log": "^3.0"
Expand Down
4 changes: 3 additions & 1 deletion example/public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@

header('Content-type: text/html; charset=UTF-8');

ini_set('display_errors', '0');

session_start();

// Uncomment following line to define the custom log location (by default the server log is used)
//define("LOGFILE", dirname(__FILE__) . "/../log/web-eid-authtoken-validation-php.log");

require __DIR__ . '/../vendor/autoload.php';
require_once __DIR__ . '/../vendor/autoload.php';

$configArr = require_once __DIR__ . '/../src/app.conf.php';
$config = Config::fromArray($configArr)->overrideFromEnv();
Expand Down
2 changes: 1 addition & 1 deletion example/src/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function validate()

try {
/* Get and remove nonce from store */
$challengeNonce = new ChallengeNonceStore()->getAndRemove();
$challengeNonce = (new ChallengeNonceStore())->getAndRemove();

$authResult = $this->ctx->authenticate(
$authToken,
Expand Down
4 changes: 2 additions & 2 deletions example/src/AuthContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,14 @@ public function trustedIntermediateCACertificates(): array

public function nonceGenerator(): ChallengeNonceGenerator
{
return new ChallengeNonceGeneratorBuilder()->withNonceTtl(300)->build();
return (new ChallengeNonceGeneratorBuilder())->withNonceTtl(300)->build();
}

public function tokenValidator(): AuthTokenValidator
{
$logger = new Logger();

return new AuthTokenValidatorBuilder($logger)
return (new AuthTokenValidatorBuilder($logger))
->withSiteOrigin(new Uri($this->config->get("origin_url")))
->withTrustedCertificateAuthorities(
...$this->trustedIntermediateCACertificates(),
Expand Down