src/AuthorizationServer.php
public function respondToAccessTokenRequest(ServerRequestInterface $request, ResponseInterface $response)
    {
        foreach ($this->enabledGrantTypes as $grantType) {
            if (!$grantType->canRespondToAccessTokenRequest($request)) {
                continue;
            }
            $tokenResponse = $grantType->respondToAccessTokenRequest(
                $request,
                $this->getResponseType(),
                $this->grantTypeAccessTokenTTL[$grantType->getIdentifier()]
            );

            if ($tokenResponse instanceof ResponseTypeInterface) {
                return $tokenResponse->generateHttpResponse($response);
            }
        }

        throw OAuthServerException::unsupportedGrantType();
    }
public function respondToAccessTokenRequest(ServerRequestInterface $request, ResponseInterface $response)
    {
        foreach ($this->enabledGrantTypes as $grantType) {
            if (!$grantType->canRespondToAccessTokenRequest($request)) {
                continue;
            }
            $tokenResponse = $grantType->respondToAccessTokenRequest(
                $request,
                $this->getResponseType(),
                $this->grantTypeAccessTokenTTL[$grantType->getIdentifier()]
            );

            if ($tokenResponse instanceof ResponseTypeInterface) {
                return $tokenResponse->generateHttpResponse($response);
            }
        }

        throw OAuthServerException::unsupportedGrantType();
    }
public function respondToAccessTokenRequest ( ServerRequestInterface $ request , ResponseInterface $ response ) { foreach ( $ this -> enabledGrantTypes as $ grantType ) { if ( ! $ grantType -> canRespondToAccessTokenRequest ( $ request ) ) { continue ; } $ tokenResponse = $ grantType -> respondToAccessTokenRequest ( $ request , $ this -> getResponseType ( ) , $ this -> grantTypeAccessTokenTTL [ $ grantType -> getIdentifier ( ) ] ) ; if ( $ tokenResponse instanceof ResponseTypeInterface ) { return $ tokenResponse -> generateHttpResponse ( $ response ) ; } } throw OAuthServerException :: unsupportedGrantType ( ) ; }
Return an access token response.

@param ServerRequestInterface $request
@param ResponseInterface      $response

@throws OAuthServerException

@return ResponseInterface
Return an access token response .