StsClient.php 766 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace AlibabaCloud\Client\Clients;
  3. use AlibabaCloud\Client\Credentials\StsCredential;
  4. use AlibabaCloud\Client\Exception\ClientException;
  5. use AlibabaCloud\Client\Signature\ShaHmac1Signature;
  6. /**
  7. * Use the STS Token to complete the authentication.
  8. */
  9. class StsClient extends Client
  10. {
  11. /**
  12. * @param string $accessKeyId Access key ID
  13. * @param string $accessKeySecret Access Key Secret
  14. * @param string $securityToken Security Token
  15. *
  16. * @throws ClientException
  17. */
  18. public function __construct($accessKeyId, $accessKeySecret, $securityToken = '')
  19. {
  20. parent::__construct(
  21. new StsCredential($accessKeyId, $accessKeySecret, $securityToken),
  22. new ShaHmac1Signature()
  23. );
  24. }
  25. }