All Products
Search
Document Center

Object Storage Service:"Access denied by authorizer's policy" error is displayed when STS grants temporary permissions to OSS

Last Updated:Mar 20, 2026

When using Security Token Service (STS) to grant temporary access to OSS operations such as upload and download, you may encounter the following error:

ErrorCode: AccessDenied
ErrorMessage: Access denied by authorizer's policy.

How it works

When your application calls STS to get a temporary token, it can pass an optional inline Policy parameter. The token's effective permissions are the intersection of two permission sets:

  • The RAM role's permissions (defined in RAM)

  • The inline Policy passed in the STS token request

The inline Policy can only narrow the role's permissions — it cannot expand them. If the inline Policy omits an Allow statement for the action your code is trying to perform, the token is denied even if the RAM role allows it.

The following Java example shows where the Policy parameter is set in an STS token request:

Java demo code showing the Policy parameter in the STS token request

Diagnose the error

The error Access denied by authorizer's policy indicates that the inline Policy in your STS token request is blocking the operation — not the RAM role itself. Identify which type of denial you have:

TypeCauseWhat to look for
Implicit denialThe inline Policy has no Allow statement for the required OSS actionA missing Allow in the Action list of your policy JSON
Explicit denialThe inline Policy has a Deny statement for the required OSS actionA Deny entry in your policy JSON

Fix the policy

  1. Identify the OSS API action your code is calling (for example, the action for uploads or the action for downloads).

  2. Open the inline Policy JSON you pass when requesting the STS token.

  3. Confirm that the policy includes an Allow statement for the required action and resource.

  4. Verify that no Deny statement in the same policy overrides the Allow.

  5. Confirm that the RAM role's own policy also grants the same action. The token cannot have permissions broader than the role.

For a complete list of OSS actions and the policy syntax for STS, see Use temporary access credentials provided by STS to access OSS.

Scope

  • OSS

  • Resource Access Management (RAM)