jimchen / aliyun-php-sdk-sts
aliyun php sdk sts
Installs: 2 251
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=5.5
- alibabacloud/sts: ^1.8
Requires (Dev)
- laravel/framework: ^6.0|^7.0|^8.0
This package is auto-updated.
Last update: 2024-11-26 13:26:25 UTC
README
阿里云STS SDK
Requirements
- PHP 5.5+
Installing
$ composer require "jimchen/aliyun-php-sdk-sts:^2.0"
Usage
use JimChen\AliyunSts\Client; $client = new Client( $accessKeyId, $accessKeySecret, $regionId, $clientName, $debug, $connectionTimeout, $timeout, $cert, $options ); $result = $client->assumeRole() ->client($clientName) ->withRoleArn($roleArn) ->withRoleSessionName($roleSessionName) ->withDurationSeconds($durationSeconds) ->request(); $result->isSuccess();
In Laravel
$ php artisan vendor:publish --provider='JimChen\AliyunSts\LaravelProvider'
$result = app('aliyun.sts')->assumeRole() ->client($clientName) ->withRoleArn($roleArn) ->withRoleSessionName($roleSessionName) ->withDurationSeconds($durationSeconds) ->request(); $result->isSuccess();
for more api usage, see https://github.com/aliyun/openapi-sdk-php
License
Apache License 2.0