TokenControllerInterface.php 933 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace OAuth2\Controller;
  3. use OAuth2\RequestInterface;
  4. use OAuth2\ResponseInterface;
  5. /**
  6. * This controller is called when a token is being requested.
  7. * it is called to handle all grant types the application supports.
  8. * It also validates the client's credentials
  9. *
  10. * ex:
  11. * > $tokenController->handleTokenRequest(OAuth2\Request::createFromGlobals(), $response = new OAuth2\Response());
  12. * > $response->send();
  13. *
  14. */
  15. interface TokenControllerInterface
  16. {
  17. /**
  18. * handleTokenRequest
  19. *
  20. * @param $request
  21. * OAuth2\RequestInterface - The current http request
  22. * @param $response
  23. * OAuth2\ResponseInterface - An instance of OAuth2\ResponseInterface to contain the response data
  24. *
  25. */
  26. public function handleTokenRequest(RequestInterface $request, ResponseInterface $response);
  27. public function grantAccessToken(RequestInterface $request, ResponseInterface $response);
  28. }