2013-02-01 16:20:32 +05:30
|
|
|
<?php
|
|
|
|
|
2013-05-09 00:12:23 +05:30
|
|
|
namespace League\OAuth2\Server\Grant;
|
2013-05-08 23:36:09 +05:30
|
|
|
|
2015-04-06 02:27:29 +05:30
|
|
|
use DateInterval;
|
2016-02-12 19:48:52 +05:30
|
|
|
use League\OAuth2\Server\Entities\Interfaces\ClientEntityInterface;
|
2016-02-12 17:25:41 +05:30
|
|
|
use League\OAuth2\Server\Entities\Interfaces\UserEntityInterface;
|
2016-02-11 23:00:01 +05:30
|
|
|
use League\OAuth2\Server\Exception\OAuthServerException;
|
2016-02-12 15:31:15 +05:30
|
|
|
use League\OAuth2\Server\Repositories\AuthCodeRepositoryInterface;
|
2016-02-12 19:02:58 +05:30
|
|
|
use League\OAuth2\Server\Repositories\RefreshTokenRepositoryInterface;
|
2016-02-12 17:25:41 +05:30
|
|
|
use League\OAuth2\Server\Repositories\UserRepositoryInterface;
|
2016-03-23 18:24:17 +05:30
|
|
|
use League\OAuth2\Server\RequestEvent;
|
2016-03-17 20:07:21 +05:30
|
|
|
use League\OAuth2\Server\ResponseTypes\HtmlResponse;
|
|
|
|
use League\OAuth2\Server\ResponseTypes\RedirectResponse;
|
2016-02-11 23:00:01 +05:30
|
|
|
use League\OAuth2\Server\ResponseTypes\ResponseTypeInterface;
|
2016-03-18 02:03:04 +05:30
|
|
|
use League\OAuth2\Server\TemplateRenderer\RendererInterface;
|
2016-02-11 23:00:01 +05:30
|
|
|
use Psr\Http\Message\ServerRequestInterface;
|
2013-02-01 16:20:32 +05:30
|
|
|
|
2016-03-09 17:02:01 +05:30
|
|
|
class AuthCodeGrant extends AbstractAuthorizeGrant
|
2014-04-06 23:44:46 +05:30
|
|
|
{
|
2016-02-12 15:31:15 +05:30
|
|
|
/**
|
|
|
|
* @var \DateInterval
|
|
|
|
*/
|
|
|
|
private $authCodeTTL;
|
2016-02-12 17:25:41 +05:30
|
|
|
|
2016-02-12 19:02:58 +05:30
|
|
|
/**
|
|
|
|
* @param \League\OAuth2\Server\Repositories\AuthCodeRepositoryInterface $authCodeRepository
|
|
|
|
* @param \League\OAuth2\Server\Repositories\RefreshTokenRepositoryInterface $refreshTokenRepository
|
|
|
|
* @param \League\OAuth2\Server\Repositories\UserRepositoryInterface $userRepository
|
|
|
|
* @param \DateInterval $authCodeTTL
|
2016-03-18 02:03:04 +05:30
|
|
|
* @param \League\OAuth2\Server\TemplateRenderer\RendererInterface|null $templateRenderer
|
2016-02-12 15:31:15 +05:30
|
|
|
*/
|
|
|
|
public function __construct(
|
|
|
|
AuthCodeRepositoryInterface $authCodeRepository,
|
2016-02-12 19:02:58 +05:30
|
|
|
RefreshTokenRepositoryInterface $refreshTokenRepository,
|
2016-02-12 17:25:41 +05:30
|
|
|
UserRepositoryInterface $userRepository,
|
2016-02-12 15:31:15 +05:30
|
|
|
\DateInterval $authCodeTTL,
|
2016-03-18 02:03:04 +05:30
|
|
|
RendererInterface $templateRenderer = null
|
2015-04-06 02:27:29 +05:30
|
|
|
) {
|
2016-02-18 17:37:23 +05:30
|
|
|
$this->setAuthCodeRepository($authCodeRepository);
|
|
|
|
$this->setRefreshTokenRepository($refreshTokenRepository);
|
2016-03-16 01:24:59 +05:30
|
|
|
$this->setUserRepository($userRepository);
|
2016-02-12 15:31:15 +05:30
|
|
|
$this->authCodeTTL = $authCodeTTL;
|
2016-02-12 19:58:24 +05:30
|
|
|
$this->refreshTokenTTL = new \DateInterval('P1M');
|
2016-03-09 17:02:01 +05:30
|
|
|
$this->templateRenderer = $templateRenderer;
|
2013-05-08 03:50:32 +05:30
|
|
|
}
|
|
|
|
|
2013-02-14 01:06:56 +05:30
|
|
|
/**
|
2016-02-20 04:39:39 +05:30
|
|
|
* Respond to an authorization request.
|
2014-11-12 23:40:29 +05:30
|
|
|
*
|
2016-02-11 23:00:01 +05:30
|
|
|
* @param \Psr\Http\Message\ServerRequestInterface $request
|
2016-02-12 15:31:15 +05:30
|
|
|
*
|
|
|
|
* @throws \League\OAuth2\Server\Exception\OAuthServerException
|
2016-02-20 04:39:39 +05:30
|
|
|
*
|
|
|
|
* @return \Psr\Http\Message\ResponseInterface
|
2013-03-31 18:07:02 +05:30
|
|
|
*/
|
2016-02-11 23:00:01 +05:30
|
|
|
protected function respondToAuthorizationRequest(
|
2016-02-12 15:31:15 +05:30
|
|
|
ServerRequestInterface $request
|
2016-02-11 23:00:01 +05:30
|
|
|
) {
|
2016-02-21 20:02:16 +05:30
|
|
|
$clientId = $this->getQueryStringParameter(
|
|
|
|
'client_id',
|
|
|
|
$request,
|
|
|
|
$this->getServerParameter('PHP_AUTH_USER', $request)
|
|
|
|
);
|
|
|
|
if (is_null($clientId)) {
|
2016-02-21 22:10:01 +05:30
|
|
|
throw OAuthServerException::invalidRequest('client_id');
|
2016-02-21 20:02:16 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
$client = $this->clientRepository->getClientEntity(
|
|
|
|
$clientId,
|
|
|
|
$this->getIdentifier()
|
|
|
|
);
|
2014-08-06 14:23:47 +05:30
|
|
|
|
2016-02-12 19:48:52 +05:30
|
|
|
if ($client instanceof ClientEntityInterface === false) {
|
2016-03-23 18:24:17 +05:30
|
|
|
$this->getEmitter()->emit(new RequestEvent('client.authentication.failed', $request));
|
2016-02-11 23:00:01 +05:30
|
|
|
throw OAuthServerException::invalidClient();
|
2013-03-31 18:07:02 +05:30
|
|
|
}
|
|
|
|
|
2016-02-21 23:43:39 +05:30
|
|
|
$redirectUriParameter = $this->getQueryStringParameter('redirect_uri', $request, $client->getRedirectUri());
|
|
|
|
if ($redirectUriParameter !== $client->getRedirectUri()) {
|
|
|
|
throw OAuthServerException::invalidClient();
|
|
|
|
}
|
|
|
|
|
2016-03-14 04:42:14 +05:30
|
|
|
$scopes = $this->validateScopes(
|
|
|
|
$this->getQueryStringParameter('scope', $request),
|
|
|
|
$client,
|
|
|
|
$client->getRedirectUri()
|
|
|
|
);
|
2016-03-17 20:07:21 +05:30
|
|
|
|
|
|
|
$postbackUri = sprintf(
|
|
|
|
'//%s%s',
|
|
|
|
$request->getServerParams()['HTTP_HOST'],
|
|
|
|
$request->getServerParams()['REQUEST_URI']
|
2016-02-12 17:25:41 +05:30
|
|
|
);
|
|
|
|
|
|
|
|
$userId = null;
|
2016-02-12 19:48:52 +05:30
|
|
|
$userHasApprovedClient = null;
|
|
|
|
if ($this->getRequestParameter('action', $request, null) !== null) {
|
|
|
|
$userHasApprovedClient = ($this->getRequestParameter('action', $request) === 'approve');
|
|
|
|
}
|
2016-02-12 15:31:15 +05:30
|
|
|
|
2016-02-12 19:48:52 +05:30
|
|
|
// Check if the user has been authenticated
|
2016-02-12 17:25:41 +05:30
|
|
|
$oauthCookie = $this->getCookieParameter('oauth_authorize_request', $request, null);
|
|
|
|
if ($oauthCookie !== null) {
|
2016-02-12 15:31:15 +05:30
|
|
|
try {
|
2016-03-17 20:07:21 +05:30
|
|
|
$oauthCookiePayload = json_decode($this->decrypt($oauthCookie));
|
2016-02-12 19:48:52 +05:30
|
|
|
if (is_object($oauthCookiePayload)) {
|
|
|
|
$userId = $oauthCookiePayload->user_id;
|
|
|
|
}
|
2016-02-12 15:31:15 +05:30
|
|
|
} catch (\LogicException $e) {
|
|
|
|
throw OAuthServerException::serverError($e->getMessage());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-02-12 17:25:41 +05:30
|
|
|
// The username + password might be available in $_POST
|
2016-02-12 19:48:52 +05:30
|
|
|
$usernameParameter = $this->getRequestParameter('username', $request, null);
|
|
|
|
$passwordParameter = $this->getRequestParameter('password', $request, null);
|
2016-02-12 17:25:41 +05:30
|
|
|
|
|
|
|
$loginError = null;
|
|
|
|
|
|
|
|
// Assert if the user has logged in already
|
|
|
|
if ($userId === null && $usernameParameter !== null && $passwordParameter !== null) {
|
|
|
|
$userEntity = $this->userRepository->getUserEntityByUserCredentials(
|
|
|
|
$usernameParameter,
|
2016-03-22 19:48:02 +05:30
|
|
|
$passwordParameter,
|
|
|
|
$this->getIdentifier(),
|
2016-03-22 20:41:20 +05:30
|
|
|
$client,
|
2016-03-22 19:48:02 +05:30
|
|
|
$scopes
|
2016-02-12 17:25:41 +05:30
|
|
|
);
|
|
|
|
|
|
|
|
if ($userEntity instanceof UserEntityInterface) {
|
|
|
|
$userId = $userEntity->getIdentifier();
|
|
|
|
} else {
|
|
|
|
$loginError = 'Incorrect username or password';
|
2016-02-12 15:31:15 +05:30
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-02-12 17:25:41 +05:30
|
|
|
// The user hasn't logged in yet so show a login form
|
|
|
|
if ($userId === null) {
|
2016-03-16 17:02:21 +05:30
|
|
|
$html = $this->getTemplateRenderer()->renderLogin([
|
2016-03-09 17:02:01 +05:30
|
|
|
'error' => $loginError,
|
2016-03-17 20:07:21 +05:30
|
|
|
'postback_uri' => $this->makeRedirectUri(
|
|
|
|
$postbackUri,
|
|
|
|
$request->getQueryParams()
|
|
|
|
),
|
2016-03-09 17:02:01 +05:30
|
|
|
]);
|
2016-02-12 17:25:41 +05:30
|
|
|
|
2016-03-17 20:07:21 +05:30
|
|
|
$htmlResponse = new HtmlResponse($this->accessTokenRepository);
|
|
|
|
$htmlResponse->setStatusCode(403);
|
|
|
|
$htmlResponse->setHtml($html);
|
2016-03-17 20:07:48 +05:30
|
|
|
|
2016-03-17 20:07:21 +05:30
|
|
|
return $htmlResponse;
|
2016-02-12 17:25:41 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
// The user hasn't approved the client yet so show an authorize form
|
|
|
|
if ($userId !== null && $userHasApprovedClient === null) {
|
2016-03-16 17:02:21 +05:30
|
|
|
$html = $this->getTemplateRenderer()->renderAuthorize([
|
2016-03-09 17:02:01 +05:30
|
|
|
'client' => $client,
|
|
|
|
'scopes' => $scopes,
|
2016-03-17 20:07:21 +05:30
|
|
|
'postback_uri' => $this->makeRedirectUri(
|
|
|
|
$postbackUri,
|
|
|
|
$request->getQueryParams()
|
|
|
|
),
|
2016-03-09 17:02:01 +05:30
|
|
|
]);
|
2016-02-12 17:25:41 +05:30
|
|
|
|
2016-03-17 20:07:21 +05:30
|
|
|
$htmlResponse = new HtmlResponse($this->accessTokenRepository);
|
|
|
|
$htmlResponse->setStatusCode(200);
|
|
|
|
$htmlResponse->setHtml($html);
|
|
|
|
$htmlResponse->setHeader('set-cookie', sprintf(
|
|
|
|
'oauth_authorize_request=%s; Expires=%s',
|
|
|
|
urlencode($this->encrypt(
|
|
|
|
json_encode([
|
|
|
|
'user_id' => $userId,
|
|
|
|
])
|
|
|
|
)),
|
|
|
|
(new \DateTime())->add(new \DateInterval('PT5M'))->format('D, d M Y H:i:s e')
|
|
|
|
));
|
|
|
|
|
|
|
|
return $htmlResponse;
|
2016-02-12 17:25:41 +05:30
|
|
|
}
|
|
|
|
|
2016-02-22 13:28:12 +05:30
|
|
|
// The user has either approved or denied the client, so redirect them back
|
2016-03-17 20:07:21 +05:30
|
|
|
$redirectUri = $client->getRedirectUri();
|
|
|
|
$redirectPayload = [];
|
2016-02-22 13:28:12 +05:30
|
|
|
|
|
|
|
$stateParameter = $this->getQueryStringParameter('state', $request);
|
2016-02-12 15:31:15 +05:30
|
|
|
if ($stateParameter !== null) {
|
|
|
|
$redirectPayload['state'] = $stateParameter;
|
|
|
|
}
|
|
|
|
|
2016-02-22 13:28:12 +05:30
|
|
|
// THe user approved the client, redirect them back with an auth code
|
2016-02-12 17:25:41 +05:30
|
|
|
if ($userHasApprovedClient === true) {
|
2016-03-24 00:06:23 +05:30
|
|
|
|
|
|
|
// Finalize the requested scopes
|
|
|
|
$scopes = $this->scopeRepository->finalizeScopes($scopes, $client, $userId);
|
|
|
|
|
2016-02-12 15:31:15 +05:30
|
|
|
$authCode = $this->issueAuthCode(
|
|
|
|
$this->authCodeTTL,
|
|
|
|
$client,
|
|
|
|
$userId,
|
|
|
|
$redirectUri,
|
|
|
|
$scopes
|
|
|
|
);
|
|
|
|
|
2016-03-17 20:07:21 +05:30
|
|
|
$redirectPayload['code'] = $this->encrypt(
|
2016-02-12 18:31:25 +05:30
|
|
|
json_encode(
|
|
|
|
[
|
|
|
|
'client_id' => $authCode->getClient()->getIdentifier(),
|
2016-02-21 23:43:39 +05:30
|
|
|
'redirect_uri' => $authCode->getRedirectUri(),
|
2016-02-12 18:31:25 +05:30
|
|
|
'auth_code_id' => $authCode->getIdentifier(),
|
|
|
|
'scopes' => $authCode->getScopes(),
|
|
|
|
'user_id' => $authCode->getUserIdentifier(),
|
2016-02-12 19:58:24 +05:30
|
|
|
'expire_time' => (new \DateTime())->add($this->authCodeTTL)->format('U'),
|
2016-02-12 18:31:25 +05:30
|
|
|
]
|
2016-03-17 20:07:21 +05:30
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
$response = new RedirectResponse($this->accessTokenRepository);
|
|
|
|
$response->setRedirectUri(
|
|
|
|
$this->makeRedirectUri(
|
|
|
|
$redirectUri,
|
|
|
|
$redirectPayload
|
|
|
|
)
|
2016-02-12 18:31:25 +05:30
|
|
|
);
|
2016-02-12 15:31:15 +05:30
|
|
|
|
2016-03-17 20:07:21 +05:30
|
|
|
return $response;
|
2016-02-12 15:31:15 +05:30
|
|
|
}
|
|
|
|
|
2016-02-22 13:28:12 +05:30
|
|
|
// The user denied the client, redirect them back with an error
|
2016-03-17 20:07:21 +05:30
|
|
|
throw OAuthServerException::accessDenied('The user denied the request', (string) $redirectUri);
|
2016-02-11 23:00:01 +05:30
|
|
|
}
|
2013-03-31 18:07:02 +05:30
|
|
|
|
|
|
|
/**
|
2016-02-20 04:39:39 +05:30
|
|
|
* Respond to an access token request.
|
2013-03-31 18:07:02 +05:30
|
|
|
*
|
2016-02-11 23:00:01 +05:30
|
|
|
* @param \Psr\Http\Message\ServerRequestInterface $request
|
|
|
|
* @param \League\OAuth2\Server\ResponseTypes\ResponseTypeInterface $responseType
|
|
|
|
* @param \DateInterval $accessTokenTTL
|
2014-12-10 18:40:35 +05:30
|
|
|
*
|
2016-02-12 19:02:58 +05:30
|
|
|
* @throws \League\OAuth2\Server\Exception\OAuthServerException
|
2016-02-20 04:39:39 +05:30
|
|
|
*
|
|
|
|
* @return \League\OAuth2\Server\ResponseTypes\ResponseTypeInterface
|
2013-03-31 18:07:02 +05:30
|
|
|
*/
|
2016-02-11 23:00:01 +05:30
|
|
|
protected function respondToAccessTokenRequest(
|
|
|
|
ServerRequestInterface $request,
|
|
|
|
ResponseTypeInterface $responseType,
|
|
|
|
DateInterval $accessTokenTTL
|
|
|
|
) {
|
2016-02-18 16:19:39 +05:30
|
|
|
// The redirect URI is required in this request
|
2016-02-21 23:43:39 +05:30
|
|
|
$redirectUri = $this->getRequestParameter('redirect_uri', $request, null);
|
2016-02-18 16:19:39 +05:30
|
|
|
if (is_null($redirectUri)) {
|
2016-02-21 22:10:01 +05:30
|
|
|
throw OAuthServerException::invalidRequest('redirect_uri');
|
2016-02-18 16:19:39 +05:30
|
|
|
}
|
|
|
|
|
2016-02-12 18:31:25 +05:30
|
|
|
// Validate request
|
|
|
|
$client = $this->validateClient($request);
|
2016-02-12 19:02:58 +05:30
|
|
|
$encryptedAuthCode = $this->getRequestParameter('code', $request, null);
|
2016-02-12 18:31:25 +05:30
|
|
|
|
2016-02-12 19:02:58 +05:30
|
|
|
if ($encryptedAuthCode === null) {
|
2016-02-12 18:31:25 +05:30
|
|
|
throw OAuthServerException::invalidRequest('code');
|
|
|
|
}
|
|
|
|
|
|
|
|
// Validate the authorization code
|
|
|
|
try {
|
2016-03-17 20:07:21 +05:30
|
|
|
$authCodePayload = json_decode($this->decrypt($encryptedAuthCode));
|
2016-02-12 18:31:25 +05:30
|
|
|
if (time() > $authCodePayload->expire_time) {
|
|
|
|
throw OAuthServerException::invalidRequest('code', 'Authorization code has expired');
|
|
|
|
}
|
2016-02-12 19:02:58 +05:30
|
|
|
|
2016-03-16 01:24:59 +05:30
|
|
|
if ($this->authCodeRepository->isAuthCodeRevoked($authCodePayload->auth_code_id) === true) {
|
2016-02-12 19:02:58 +05:30
|
|
|
throw OAuthServerException::invalidRequest('code', 'Authorization code has been revoked');
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($authCodePayload->client_id !== $client->getIdentifier()) {
|
|
|
|
throw OAuthServerException::invalidRequest('code', 'Authorization code was not issued to this client');
|
|
|
|
}
|
2016-02-21 23:43:39 +05:30
|
|
|
|
|
|
|
if ($authCodePayload->redirect_uri !== $redirectUri) {
|
|
|
|
throw OAuthServerException::invalidRequest('redirect_uri', 'Invalid redirect URI');
|
|
|
|
}
|
2016-03-15 05:40:47 +05:30
|
|
|
|
|
|
|
$scopes = [];
|
|
|
|
foreach ($authCodePayload->scopes as $scopeId) {
|
|
|
|
$scope = $this->scopeRepository->getScopeEntityByIdentifier(
|
|
|
|
$scopeId,
|
|
|
|
$this->getIdentifier(),
|
|
|
|
$client->getIdentifier()
|
|
|
|
);
|
|
|
|
|
|
|
|
if (!$scope) {
|
2016-03-18 04:55:32 +05:30
|
|
|
// @codeCoverageIgnoreStart
|
2016-03-15 05:40:47 +05:30
|
|
|
throw OAuthServerException::invalidScope($scopeId);
|
2016-03-18 04:55:32 +05:30
|
|
|
// @codeCoverageIgnoreEnd
|
2016-03-15 05:40:47 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
$scopes[] = $scope;
|
|
|
|
}
|
2016-02-12 18:31:25 +05:30
|
|
|
} catch (\LogicException $e) {
|
2016-02-21 22:10:01 +05:30
|
|
|
throw OAuthServerException::invalidRequest('code', 'Cannot decrypt the authorization code');
|
2016-02-12 18:31:25 +05:30
|
|
|
}
|
|
|
|
|
2016-02-12 19:02:58 +05:30
|
|
|
// Issue and persist access + refresh tokens
|
2016-03-15 05:40:47 +05:30
|
|
|
$accessToken = $this->issueAccessToken($accessTokenTTL, $client, $authCodePayload->user_id, $scopes);
|
2016-02-12 19:02:58 +05:30
|
|
|
$refreshToken = $this->issueRefreshToken($accessToken);
|
2016-02-12 18:31:25 +05:30
|
|
|
|
2016-02-12 19:02:58 +05:30
|
|
|
// Inject tokens into response type
|
2016-02-12 18:31:25 +05:30
|
|
|
$responseType->setAccessToken($accessToken);
|
2016-02-12 19:02:58 +05:30
|
|
|
$responseType->setRefreshToken($refreshToken);
|
2014-04-06 23:44:46 +05:30
|
|
|
|
2016-02-12 18:31:25 +05:30
|
|
|
return $responseType;
|
2016-02-11 23:00:01 +05:30
|
|
|
}
|
2013-03-31 18:07:02 +05:30
|
|
|
|
2016-02-12 23:02:09 +05:30
|
|
|
/**
|
2016-02-20 04:39:39 +05:30
|
|
|
* {@inheritdoc}
|
2016-02-12 23:02:09 +05:30
|
|
|
*/
|
|
|
|
public function respondToRequest(
|
|
|
|
ServerRequestInterface $request,
|
|
|
|
ResponseTypeInterface $responseType,
|
|
|
|
\DateInterval $accessTokenTTL
|
|
|
|
) {
|
2016-03-09 02:27:43 +05:30
|
|
|
if (
|
|
|
|
array_key_exists('response_type', $request->getQueryParams())
|
2016-02-12 23:15:47 +05:30
|
|
|
&& $request->getQueryParams()['response_type'] === 'code'
|
2016-02-12 23:02:09 +05:30
|
|
|
) {
|
|
|
|
return $this->respondToAuthorizationRequest($request);
|
|
|
|
}
|
2016-03-09 02:27:43 +05:30
|
|
|
|
|
|
|
return $this->respondToAccessTokenRequest($request, $responseType, $accessTokenTTL);
|
2016-02-12 23:02:09 +05:30
|
|
|
}
|
|
|
|
|
2013-03-31 18:07:02 +05:30
|
|
|
/**
|
2016-02-20 04:39:39 +05:30
|
|
|
* {@inheritdoc}
|
2013-02-14 01:06:56 +05:30
|
|
|
*/
|
2016-02-11 23:00:01 +05:30
|
|
|
public function canRespondToRequest(ServerRequestInterface $request)
|
|
|
|
{
|
2016-02-20 04:39:39 +05:30
|
|
|
return
|
2016-02-11 23:00:01 +05:30
|
|
|
(
|
2016-02-12 23:15:47 +05:30
|
|
|
array_key_exists('response_type', $request->getQueryParams())
|
2016-02-11 23:00:01 +05:30
|
|
|
&& $request->getQueryParams()['response_type'] === 'code'
|
|
|
|
&& isset($request->getQueryParams()['client_id'])
|
2016-02-12 23:02:09 +05:30
|
|
|
)
|
2016-03-09 02:27:43 +05:30
|
|
|
|| parent::canRespondToRequest($request);
|
2013-02-01 16:20:32 +05:30
|
|
|
}
|
2016-02-12 15:31:15 +05:30
|
|
|
|
|
|
|
/**
|
2016-02-20 04:39:39 +05:30
|
|
|
* Return the grant identifier that can be used in matching up requests.
|
2016-02-12 15:31:15 +05:30
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getIdentifier()
|
|
|
|
{
|
|
|
|
return 'authorization_code';
|
|
|
|
}
|
2013-09-07 22:29:44 +05:30
|
|
|
}
|