测试oss 改为1分钟
parent
5bdb89df7d
commit
b3e37c7ea4
|
@ -148,12 +148,15 @@ namespace IRaCIS.Api.Controllers
|
||||||
IClientProfile profile = DefaultProfile.GetProfile("cn-shanghai", configuration["AliyunOSS:accessKeyId"], configuration["AliyunOSS:accessKeySecret"]);
|
IClientProfile profile = DefaultProfile.GetProfile("cn-shanghai", configuration["AliyunOSS:accessKeyId"], configuration["AliyunOSS:accessKeySecret"]);
|
||||||
DefaultAcsClient client = new DefaultAcsClient(profile);
|
DefaultAcsClient client = new DefaultAcsClient(profile);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 创建一个STS请求
|
// 创建一个STS请求
|
||||||
AssumeRoleRequest request = new AssumeRoleRequest
|
AssumeRoleRequest request = new AssumeRoleRequest
|
||||||
{
|
{
|
||||||
RoleArn = "acs:ram::1899121822495495:role/oss-upload", // 角色ARN,需要替换为你的角色ARN
|
RoleArn = "acs:ram::1899121822495495:role/oss-upload", // 角色ARN,需要替换为你的角色ARN
|
||||||
RoleSessionName = "session-name", // 角色会话名称,可自定义
|
RoleSessionName = $"session-name-{Guid.NewGuid()}", // 角色会话名称,可自定义
|
||||||
DurationSeconds = 3600, // 令牌有效期(单位:秒),这里设置为1小时
|
DurationSeconds = 60, // 令牌有效期(单位:秒),这里设置为1小时
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue