AccessToken.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /*
  3. * This file is part of the overtrue/wechat.
  4. *
  5. * (c) overtrue <i@overtrue.me>
  6. *
  7. * This source file is subject to the MIT license that is bundled
  8. * with this source code in the file LICENSE.
  9. */
  10. namespace EasyWeChat\OpenWork\SuiteAuth;
  11. use EasyWeChat\Kernel\AccessToken as BaseAccessToken;
  12. /**
  13. * AccessToken.
  14. *
  15. * @author xiaomin <keacefull@gmail.com>
  16. */
  17. class AccessToken extends BaseAccessToken
  18. {
  19. /**
  20. * @var string
  21. */
  22. protected $requestMethod = 'POST';
  23. /**
  24. * @var string
  25. */
  26. protected $endpointToGetToken = 'cgi-bin/service/get_suite_token';
  27. /**
  28. * @var string
  29. */
  30. protected $tokenKey = 'suite_access_token';
  31. /**
  32. * @var string
  33. */
  34. protected $cachePrefix = 'easywechat.kernel.suite_access_token.';
  35. /**
  36. * Credential for get token.
  37. *
  38. * @return array
  39. */
  40. protected function getCredentials(): array
  41. {
  42. return [
  43. 'suite_id' => $this->app['config']['suite_id'],
  44. 'suite_secret' => $this->app['config']['suite_secret'],
  45. 'suite_ticket' => $this->app['suite_ticket']->getTicket(),
  46. ];
  47. }
  48. }