Created rest route to perform authentication

This commit is contained in:
Alejandro Celaya
2016-07-04 14:45:18 +02:00
parent 56b2bd3d56
commit dfc5bfd0f2
9 changed files with 263 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
<?php
namespace Acelaya\UrlShortener\Service;
use Acelaya\UrlShortener\Entity\RestToken;
use Acelaya\UrlShortener\Exception\AuthenticationException;
use Acelaya\UrlShortener\Exception\InvalidArgumentException;
interface RestTokenServiceInterface
{
/**
* @param string $token
* @return RestToken
* @throws InvalidArgumentException
*/
public function getByToken($token);
/**
* Creates and returns a new RestToken if username and password are correct
* @param $username
* @param $password
* @return RestToken
* @throws AuthenticationException
*/
public function createToken($username, $password);
}