TokenInterface.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. namespace OAuth\Common\Token;
  3. /**
  4. * Base token interface for any OAuth version.
  5. */
  6. interface TokenInterface
  7. {
  8. /**
  9. * Denotes an unknown end of life time.
  10. */
  11. const EOL_UNKNOWN = -9001;
  12. /**
  13. * Denotes a token which never expires, should only happen in OAuth1.
  14. */
  15. const EOL_NEVER_EXPIRES = -9002;
  16. /**
  17. * @return string
  18. */
  19. public function getAccessToken();
  20. /**
  21. * @return int
  22. */
  23. public function getEndOfLife();
  24. /**
  25. * @return array
  26. */
  27. public function getExtraParams();
  28. /**
  29. * @param string $accessToken
  30. */
  31. public function setAccessToken($accessToken);
  32. /**
  33. * @param int $endOfLife
  34. */
  35. public function setEndOfLife($endOfLife);
  36. /**
  37. * @param int $lifetime
  38. */
  39. public function setLifetime($lifetime);
  40. /**
  41. * @param array $extraParams
  42. */
  43. public function setExtraParams(array $extraParams);
  44. /**
  45. * @return string
  46. */
  47. public function getRefreshToken();
  48. /**
  49. * @param string $refreshToken
  50. */
  51. public function setRefreshToken($refreshToken);
  52. }