AdminTokenServiceInterface.php 953 B

12345678910111213141516171819202122232425262728293031323334353637
  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 Admins
  9. *
  10. * @api
  11. * @since 100.0.2
  12. */
  13. interface AdminTokenServiceInterface
  14. {
  15. /**
  16. * Create access token for admin given the admin credentials.
  17. *
  18. * @param string $username
  19. * @param string $password
  20. * @return string Token created
  21. * @throws \Magento\Framework\Exception\InputException For invalid input
  22. * @throws \Magento\Framework\Exception\AuthenticationException
  23. * @throws \Magento\Framework\Exception\LocalizedException
  24. */
  25. public function createAdminAccessToken($username, $password);
  26. /**
  27. * Revoke token by admin id.
  28. *
  29. * @param int $adminId
  30. * @return bool
  31. * @throws \Magento\Framework\Exception\LocalizedException
  32. */
  33. public function revokeAdminAccessToken($adminId);
  34. }