开发者社区> 问答> 正文

STS policy 设置为对某一目录操作,java后台通过令牌查询这一目录文件列表无权限,何解?

扮演的角色 给的权限: AliyunOSSFullAccess, STS 里设置的policy如下:

{
  "Version": "1", 
  "Statement": [
      {
          "Action": [
              "oss:*"
          ], 
          "Resource": [
              "acs:oss:*:*:baoquan2/123/123456/*"
          ], 
          "Effect": "Allow"
      }
 ]
}

java代码 阿里云问题.png图片.png

问题: Java里调用listObjects就报错,说无权限

com.aliyun.oss.OSSException: Access denied by authorizer's policy.
[ErrorCode]: AccessDenied
[RequestId]: 5F291284C3F722373575663C
[HostId]: baoquan2.oss-cn-hangzhou.aliyuncs.com
[ResponseError]:
<?xml version="1.0" encoding="UTF-8"?>
<Error>
  <Code>AccessDenied</Code>
  <Message>Access denied by authorizer's policy.</Message>
  <RequestId>5F291284C3F722373575663C</RequestId>
  <HostId>baoquan2.oss-cn-hangzhou.aliyuncs.com</HostId>
</Error>

展开
收起
游客tacabd64xlehs 2020-08-04 15:49:07 1010 0
0 条回答
写回答
取消 提交回答
问答排行榜
最热
最新

相关电子书

更多
Spring Cloud Alibaba - 重新定义 Java Cloud-Native 立即下载
The Reactive Cloud Native Arch 立即下载
JAVA开发手册1.5.0 立即下载