PHP code example of luoyy / aliyun-core
1. Go to this page and download the library: Download luoyy/aliyun-core library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
luoyy / aliyun-core example snippets
luoyy\AliCore\Providers\AcsClientServiceProvider
/**
* STS DEMO
*/
use luoyy\AliCore\Facades\AcsClient;
use luoyy\AliCore\Sts\Request\AssumeRoleRequest;
$request = new AssumeRoleRequest();
$request->setRoleSessionName("client_name");
$request->setRoleArn(/*role_arn*/);
$request->setPolicy(/*policy*/);
$request->setDurationSeconds(/*token_expire_time*/);
$response = AcsClient::getAcsResponse($request);
var_dump($response);