Added authentication failure events

This commit is contained in:
Alex Bilbie
2014-09-30 22:16:26 +01:00
parent 643c3493c4
commit b68a5c2abb
6 changed files with 112 additions and 0 deletions

View File

@@ -19,6 +19,7 @@ use League\OAuth2\Server\Entity\SessionEntity;
use League\OAuth2\Server\Entity\AccessTokenEntity;
use League\OAuth2\Server\Entity\AuthCodeEntity;
use League\OAuth2\Server\Util\SecureKey;
use League\OAuth2\Server\Event;
/**
* Auth code grant class
@@ -92,6 +93,7 @@ class AuthCodeGrant extends AbstractGrant
);
if (($client instanceof ClientEntity) === false) {
$this->server->getEventEmitter()->emit(new Event\ClientAuthenticationFailedEvent($this->server->getRequest()));
throw new Exception\InvalidClientException();
}
@@ -192,6 +194,7 @@ class AuthCodeGrant extends AbstractGrant
);
if (($client instanceof ClientEntity) === false) {
$this->server->getEventEmitter()->emit(new Event\ClientAuthenticationFailedEvent($this->server->getRequest()));
throw new Exception\InvalidClientException();
}