ConsumerInterface.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\Oauth;
  7. /**
  8. * Oauth consumer interface.
  9. *
  10. * @api
  11. * @since 100.0.2
  12. */
  13. interface ConsumerInterface
  14. {
  15. /**
  16. * Validate consumer data (e.g. Key and Secret length).
  17. *
  18. * @return bool True if the consumer data is valid.
  19. * @throws \Exception
  20. */
  21. public function validate();
  22. /**
  23. * Get the consumer Id.
  24. *
  25. * @return int
  26. */
  27. public function getId();
  28. /**
  29. * Get consumer key.
  30. *
  31. * @return string
  32. */
  33. public function getKey();
  34. /**
  35. * Get consumer secret.
  36. *
  37. * @return string
  38. */
  39. public function getSecret();
  40. /**
  41. * Get consumer callback Url.
  42. *
  43. * @return string
  44. */
  45. public function getCallbackUrl();
  46. /**
  47. * Get when the consumer was created.
  48. *
  49. * @return string
  50. */
  51. public function getCreatedAt();
  52. /**
  53. * Check if the consumer key has not expired for Oauth token exchange usage
  54. *
  55. * @return bool
  56. */
  57. public function isValidForTokenExchange();
  58. }