AccessToken.php 782 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. * This file is part of the apiadmin/tiktok.
  4. */
  5. namespace App\Libs\TikTok\OpenPlatform\Auth;
  6. use App\Libs\TikTok\OpenPlatform\Kernel\AccessToken as BaseAccessToken;
  7. /**
  8. * AccessToken 【用于开放平台获取授权AccessToken】
  9. *
  10. * @author zhaoxiang <zhaoxiang051405@gmail.com>
  11. */
  12. class AccessToken extends BaseAccessToken {
  13. /**
  14. * @var string
  15. */
  16. protected $endpointToGetToken = 'oauth/client_token/';
  17. /**
  18. * 配置AccessToken的
  19. *
  20. * @return array
  21. */
  22. protected function getCredentials(): array
  23. {
  24. return [
  25. 'client_key' => $this->app['config']['app_id'],
  26. 'client_secret' => $this->app['config']['secret'],
  27. 'grant_type' => 'client_credential',
  28. ];
  29. }
  30. }