CustomerTokenServiceInterface.php 837 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Integration\Api;
  7. /**
  8. * Interface providing token generation for Customers
  9. *
  10. * @api
  11. * @since 100.0.2
  12. */
  13. interface CustomerTokenServiceInterface
  14. {
  15. /**
  16. * Create access token for admin given the customer credentials.
  17. *
  18. * @param string $username
  19. * @param string $password
  20. * @return string Token created
  21. * @throws \Magento\Framework\Exception\AuthenticationException
  22. */
  23. public function createCustomerAccessToken($username, $password);
  24. /**
  25. * Revoke token by customer id.
  26. *
  27. * @param int $customerId
  28. * @return bool
  29. * @throws \Magento\Framework\Exception\LocalizedException
  30. */
  31. public function revokeCustomerAccessToken($customerId);
  32. }