# aliyun-sdk-sts **Repository Path**: jiajialu/aliyun-sdk-sts ## Basic Information - **Project Name**: aliyun-sdk-sts - **Description**: 阿里云SDK临时密钥授权STS管理包重构,支持composer方式使用 - **Primary Language**: PHP - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 3 - **Forks**: 0 - **Created**: 2018-12-14 - **Last Updated**: 2022-06-13 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # aliyun-sdk-sts #### 项目介绍 阿里云SDK临时密钥授权STS管理包重构,支持composer方式使用 #### 使用说明 ```php ", ""); $client = new DefaultAcsClient($profile); // 角色资源描述符,在RAM的控制台的资源详情页上可以获取 $roleArn = ""; // 在扮演角色(AssumeRole)时,可以附加一个授权策略,进一步限制角色的权限; // 详情请参考《RAM使用指南》 // 此授权策略表示读取所有OSS的只读权限 $policy=<<setRoleSessionName("client_name"); $request->setRoleArn($roleArn); $request->setPolicy($policy); $request->setDurationSeconds(3600); try { $response = $client->getAcsResponse($request); print_r($response); } catch(ServerException $e) { print "Error: " . $e->getErrorCode() . " Message: " . $e->getMessage() . "\n"; } catch(ClientException $e) { print "Error: " . $e->getErrorCode() . " Message: " . $e->getMessage() . "\n"; } ``` 在您使用STS的SDK前,请仔细阅读RAM使用指南中的角色管理部分,并阅读STS的API文档 更多用法参考aliyun官方文档:[https://help.aliyun.com/document_detail/28756.html](https://help.aliyun.com/document_detail/28756.html) #### 参与贡献 1. Fork 本项目 2. 新建 Feat_xxx 分支 3. 提交代码 4. 新建 Pull Request