ServiceInterface.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. namespace OAuth\OAuth1\Service;
  3. use OAuth\Common\Consumer\CredentialsInterface;
  4. use OAuth\Common\Storage\TokenStorageInterface;
  5. use OAuth\Common\Token\TokenInterface;
  6. use OAuth\Common\Http\Client\ClientInterface;
  7. use OAuth\Common\Http\Uri\UriInterface;
  8. use OAuth\Common\Http\Exception\TokenResponseException;
  9. use OAuth\Common\Service\ServiceInterface as BaseServiceInterface;
  10. use OAuth\OAuth1\Signature\SignatureInterface;
  11. /**
  12. * Defines the common methods across OAuth 1 services.
  13. */
  14. interface ServiceInterface extends BaseServiceInterface
  15. {
  16. /**
  17. * Retrieves and stores/returns the OAuth1 request token obtained from the service.
  18. *
  19. * @return TokenInterface $token
  20. *
  21. * @throws TokenResponseException
  22. */
  23. public function requestRequestToken();
  24. /**
  25. * Retrieves and stores/returns the OAuth1 access token after a successful authorization.
  26. *
  27. * @param string $token The request token from the callback.
  28. * @param string $verifier
  29. * @param string $tokenSecret
  30. *
  31. * @return TokenInterface $token
  32. *
  33. * @throws TokenResponseException
  34. */
  35. public function requestAccessToken($token, $verifier, $tokenSecret);
  36. /**
  37. * @return UriInterface
  38. */
  39. public function getRequestTokenEndpoint();
  40. }