diff --git a/htdocs/PI/index.php b/htdocs/PI/index.php index 2aa31e9c9..117558398 100644 --- a/htdocs/PI/index.php +++ b/htdocs/PI/index.php @@ -390,7 +390,7 @@ function authByCert() { // Check if it is registered API Authentication credential. $authEntServ = \Factory::getAPIAuthenticationService(); - $authEnt = $authEntServ->getAPIAuthentication($this->dn, "X509"); + $authEnt = $authEntServ->getAPIAuthentication($this->dn); if (!is_null($authEnt)) { $authEntServ->updateLastUseTime($authEnt); diff --git a/lib/Gocdb_Services/APIAuthenticationService.php b/lib/Gocdb_Services/APIAuthenticationService.php index 8b939a04a..5aa78e238 100644 --- a/lib/Gocdb_Services/APIAuthenticationService.php +++ b/lib/Gocdb_Services/APIAuthenticationService.php @@ -37,21 +37,19 @@ function __construct() { * Returns the APIAuthentication entity associated with the given identifier. * * @param string $ident Identifier (e.g. X.509 DN as string) - * @param string $type Identifyer type (e.g. "X509") * @return \APIAuthentication APIAuthentication associated with this identifier */ - public function getAPIAuthentication($ident, $type) { + public function getAPIAuthentication($ident) { if (!is_string($ident)) { throw new \LogicException("Expected string APIAuthentication identifier."); } $dql = "SELECT a FROM APIAuthentication a " . - "WHERE (a.identifier = :ident AND a.type = :type)" ; + "WHERE (a.identifier = :ident)" ; $qry = $this->em->createQuery($dql); $qry->setParameter('ident', $ident); - $qry->setParameter('type', $type); $apiAuth = $qry->getOneOrNullResult();