BearerTokenClient.php 645 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace AlibabaCloud\Client\Clients;
  3. use AlibabaCloud\Client\Exception\ClientException;
  4. use AlibabaCloud\Client\Signature\BearerTokenSignature;
  5. use AlibabaCloud\Client\Credentials\BearerTokenCredential;
  6. /**
  7. * Use the Bearer Token to complete the authentication.
  8. *
  9. * @package AlibabaCloud\Client\Clients
  10. */
  11. class BearerTokenClient extends Client
  12. {
  13. /**
  14. * @param string $bearerToken
  15. *
  16. * @throws ClientException
  17. */
  18. public function __construct($bearerToken)
  19. {
  20. parent::__construct(
  21. new BearerTokenCredential($bearerToken),
  22. new BearerTokenSignature()
  23. );
  24. }
  25. }