Introduction
Recently, I worked with a customer on a security architecture challenge involving a SaaS platform that needed to provision and manage Oracle Cloud Infrastructure (OCI) resources on behalf of its customers.
The platform is designed to operate within OCI across multiple tenancies, with its own identity provider, authentication mechanisms, users, and authorization controls. Through its control plane, customers can request operations such as provisioning compute instances, configuring networks, or managing existing cloud resources.
Each customer had dedicated compartments within OCI, and two security requirements were fundamental: tasks should be executed with minimum privileges, and customers should only be able to manage resources within their assigned compartments.
The challenge was how to enforce these requirements without creating and maintaining a large number of OCI users, groups, and policies as the number of customers increased.
In this article, I want to share the approach we developed using OCI Workload Identity Federation with Ephemeral Resource Principal Session Tokens (RPST), specifically the JWT-to-RPST token exchange grant type.

This article does not cover the detailed configuration of Identity Propagation Trust. For implementation details, please see the references at the end of the article.
Understanding the Security Requirements
The SaaS platform already had its own security architecture, including customer authentication, request validation, and authorization controls. An internal worker was responsible for processing requests, obtaining the necessary tokens, and executing the corresponding operations in OCI.
The existing security architecture of the SaaS platform is outside the scope of this article. Our focus is on how we designed the OCI authorization model to securely propagate the external authorization context and enforce the appropriate permissions and resource boundaries through OCI IAM policies.
We needed to address two requirements:
Least Privilege
A process responsible for starting or stopping compute instances, for example, should not automatically receive permissions to administer networks, delete storage resources, or perform unrelated operations.
Likewise, a process provisioning a compute instance may require permissions to create the instance and use specific network resources, but this does not mean it needs broad administrative access to all resource families.
Customer Isolation
Every customer had its own OCI compartment structure. A security token issued for a task or operation associated with one customer’s compartments should not authorize operations on another customer’s compartments or resources.
Why Traditional IAM Approaches Become Difficult to Scale
A traditional approach could involve creating an OCI user for every customer and assigning permissions to the corresponding compartment.
However, granting each user all the permissions required by the platform would introduce unnecessarily broad privileges.
A more restrictive design could use separate identities or profiles for compute administration, networking, storage, auditing, and operational tasks.
Consider the application serving 1,000 customers, with five permission profiles per customer. That could require approximately 5,000 OCI users, along with their group memberships, credentials, and permissions. With 2,000 customers, the same model could require 10,000 users.
Compartment tags and conditional IAM policies could help reduce the number of policy statements, but they would not eliminate the need to manage a growing number of OCI identities.
What we needed was a model where authorization could depend on the context of each task or operation, rather than on a permanent OCI identity created for every customer and permission profile.
A Different Approach with JWT-to-RPST
OCI Workload Identity Federation provides a way for an external workload to exchange a trusted JWT for an ephemeral Resource Principal Session Token.
OCI IAM establishes trust with the external issuer through an Identity Propagation Trust configuration. The configuration determines which issuer is trusted, how incoming tokens are validated, and which claims can be propagated into the resulting RPST.
These claims become attributes available for OCI IAM policy evaluation.
The RPST represents an authenticated workload session rather than a permanent OCI user. The remote worker uses the RPST and its associated private key to sign OCI API requests.
For our scenario, this introduced two important capabilities: avoiding the creation of OCI users for every customer and permission profile, and making selected external authorization attributes available to OCI IAM.
How the Authorization Context Reaches OCI
At a high level, the process is:
- The SaaS platform authenticates the customer and authorizes the requested task or operation.
- Its internal worker obtains a signed JWT containing the relevant authorization context.
- The JWT is exchanged for an RPST through the OCI IAM service, using the configured Identity Propagation Trust.
- Selected claims are propagated into the RPST.
- The remote worker uses the RPST and its associated private key to make signed OCI API requests.
- OCI IAM evaluates the requested operation, resource scope, and propagated claims before granting access.

Figure 1 — End-to-End Authorization Flow. The SaaS Control Plane, internal worker, external IdP, OCI IAM service, and Identity Propagation Trust. The diagram illustrates RPST issuance, OCI API requests signed with the associated private key, and the OCI IAM authorization decision.
The external platform remains responsible for its own authorization model. OCI IAM independently determines whether the corresponding cloud operation is permitted.
The fact that the worker successfully exchanges a JWT for an RPST does not imply authorization to access OCI resources.
Designing Authorization Around External Claims
For this implementation, we focused on two elements of the authorization context:
- Customer context: Identifies the customer or logical resource boundary associated with the request.
- Permission context: Identifies the OCI API operation or group of operations authorized for the task.
For example, the relevant portion of an incoming JWT could contain:
{
"sub": "external-workload",
"Customer_Code": "1070",
"permission": "ListInstances"
}
This is a simplified representation, not a complete JWT.
Using Identity Propagation Trust, selected claims can be propagated into the RPST and evaluated through principal attributes such as:
request.principal.ext_Customer_Code
request.principal.ext_permission
Note: Selected JWT claims are propagated into the RPST with the ext_ prefix. For example, Customer_Code becomes ext_Customer_Code and is evaluated in IAM policies as request.principal.ext_Customer_Code, according to the configured claim mapping.
The claim names and their mappings must be consistent with the JWT issued by the external system and the Identity Propagation Trust configuration.
These attributes do not grant permissions by themselves. They provide context that OCI IAM policies can evaluate together with the requested operation and target resource.
1. Defining Customer Boundaries Using Compartment Tags
The first requirement is to ensure that every operation remains within the compartments associated with the customer.
One approach is to assign a defined tag containing the customer identifier to the relevant OCI compartments.
For example, compartments belonging to customer 1070 could be tagged with:
Customer.Customer_Code = 1070
The IAM policy can then compare this tag with the customer identifier propagated into the RPST:
target.resource.compartment.tag.Customer.Customer_Code =
request.principal.ext_Customer_Code
This allows the policy to evaluate whether the target resource belongs to the customer propagated through the token.
Why Use Compartment Tags?
Another option is to compare the external customer identifier directly with a compartment name or OCID. However, these alternatives introduce some limitations.
Using compartment names requires attention to the hierarchy because the same name may exist under different parent compartments. Conditions based on compartment names or OCIDs can also require additional policies for certain operations, particularly resource listing. Using compartment tags avoids this specific listing limitation, as described in the OCI documentation.
For our scenario, defined tags applied to compartments provide a more flexible approach.
A customer may have multiple compartments for production, development, shared services, or different applications. By assigning the same customer identifier tag to these compartments, the same authorization context can apply across the customer’s environment.
This also works with hierarchical or parallel compartment structures. In a hierarchy, tagging the parent compartment can extend the authorization scope to its descendants without requiring the same tag on each child. Compartments in separate branches must be tagged independently to be included in the same customer authorization scope.
For example:
Customer-1070 [Customer.Customer_Code = 1070]
├── Production
├── Development
└── Shared
The external platform does not need to include the name or OCID of every compartment in the token. The policy evaluates the customer identifier against the compartment tag and its applicable hierarchical scope.

Figure 2 — Compartment Tag Scope. The Customer_Code claim from the incoming JWT is propagated as ext_Customer_Code in the RPST and compared with the compartment tag. The diagram shows a tagged parent compartment covering its descendants and a separately tagged compartment in another branch.
For additional information, refer to Using Tags to Manage Access.
2. Defining Operation-Level Permissions
The second requirement is to restrict which operations the worker can perform.
One approach is to include the OCI API operation in the JWT and compare it with the operation being requested:
request.operation = request.principal.ext_permission
We can also use request.permission when the authorization model is based on OCI permissions rather than API operation names.
For details about these conditions and the permissions required by different OCI APIs, refer to:
Using an individual API operation in the claim provides a restrictive model. For example, a token containing GetBucket can satisfy the corresponding operation condition, but not conditions requiring CreateBucket or DeleteBucket.
However, some workflows require multiple related operations.
In these situations, we can group multiple OCI permissions or API operations into a logical permission group using OCI IAM policy statements and conditions.
For example, a claim containing BUCKET_MANAGER could be mapped to GetBucket, CreateBucket, and DeleteBucket.
BUCKET_MANAGER is not a native OCI permission. It is a logical group defined through OCI IAM policy conditions, based on the tasks and workflows that the application or worker needs to execute.
With this approach, one RPST can satisfy several policy statements corresponding to the operations included in that group.

Figure 3 — API Operations vs. Permission Groups. Direct API operation matching using request.operation is compared with a logical permission group mapped to multiple OCI API operations through IAM policy conditions.
We can use either approach or combine them, depending on the permissions required by each task or workflow.
3. Combining the Conditions: Different Authorization Models
Our IAM policies can accommodate different authorization requirements. We do not need to choose exclusively between API operations and permission groups.
The following three examples illustrate how both approaches can coexist within the same authorization model.
Example A — Authorization Based on Individual API Operations
Consider a process that needs to perform different operations on compute instances without receiving broad instance administration privileges. In this approach, each security token carries the specific OCI API operation authorized for the task.
For example, a token containing InstanceAction can authorize power-related actions, such as starting, stopping, or rebooting an instance.
Authorization context
Permission Type: API Operation
ext_permission: InstanceAction
ext_Customer_Code: 1070
IAM Policy
Allow any-user to use instances in tenancy where all {
request.principal.type = 'identityfederateddomainapp',
request.principal.ext_permission = request.operation,
target.resource.compartment.tag.Customer.Customer_Code = request.principal.ext_Customer_Code
}
The policy is not limited to InstanceAction. It can evaluate different OCI API operations based on the value propagated in ext_permission, provided those operations are covered by the use instances policy scope.
In this example, a token containing InstanceAction can satisfy the policy condition for that API operation, but not for unrelated operations such as UpdateInstance or TerminateInstance.
The customer tag condition also restricts authorization through this policy to the corresponding customer compartments.
Example B — A Permission Group with Explicitly Allowed Operations
Now consider that the worker needs to perform multiple operations on objects in OCI Object Storage.
Instead of requiring a separate authorization context for every operation, we can define a logical group called OBJECT_MANAGER.
For this example, the group is associated with four API operations:
ListObjectsGetObjectCreateObjectDeleteObject
Authorization context
Permission Type: Permission Group
ext_permission: OBJECT_MANAGER
ext_Customer_Code: 1070
IAM Policies
Allow any-user to manage objects in tenancy where all {
request.principal.type = 'identityfederateddomainapp',
request.principal.ext_permission = 'OBJECT_MANAGER',
request.operation = 'ListObjects',
target.resource.compartment.tag.Customer.Customer_Code = request.principal.ext_Customer_Code
}
Allow any-user to manage objects in tenancy where all {
request.principal.type = 'identityfederateddomainapp',
request.principal.ext_permission = 'OBJECT_MANAGER',
request.operation = 'GetObject',
target.resource.compartment.tag.Customer.Customer_Code = request.principal.ext_Customer_Code
}
Allow any-user to manage objects in tenancy where all {
request.principal.type = 'identityfederateddomainapp',
request.principal.ext_permission = 'OBJECT_MANAGER',
request.operation = 'CreateObject',
target.resource.compartment.tag.Customer.Customer_Code = request.principal.ext_Customer_Code
}
Allow any-user to manage objects in tenancy where all {
request.principal.type = 'identityfederateddomainapp',
request.principal.ext_permission = 'OBJECT_MANAGER',
request.operation = 'DeleteObject',
target.resource.compartment.tag.Customer.Customer_Code = request.principal.ext_Customer_Code
}
Notice that all four statements use the same permission group condition:
request.principal.ext_permission = 'OBJECT_MANAGER'
What changes is the allowed API operation.
When the RPST contains OBJECT_MANAGER, the worker can satisfy the permission group condition in all four statements. However, the requested operation must also match the corresponding request.operation condition.
For example, GetObject can match the second statement, while DeleteObject can match the fourth.
An operation such as RenameObject does not match any of these statements and therefore will not be authorized by this policy set, even though the statements use the manage objects verb.
This allows a single RPST session to support multiple operations while keeping the permitted API operations explicitly defined.
Note: The policies above are presented separately for illustrative purposes. We could also use a single policy statement combining the four API operations with an any condition:
any {
request.operation = 'ListObjects',
request.operation = 'GetObject',
request.operation = 'CreateObject',
request.operation = 'DeleteObject'
}
This any block would be combined with the other authorization conditions, such as the permission group, customer identifier, and principal type.
Separating the policy statements becomes particularly useful when a permission group needs to cover operations across different OCI resource families, such as Compute, Networking, and Vault, where different resource types, verbs, and conditions may be required.
Example C — A Permission Group with Broader Resource Management Capabilities
In other situations, the worker may require broader permissions across one or more OCI resource families to perform a task.
For example, an instance management process may need to create, update, and terminate instances.
Rather than enumerating each API operation, we can define a permission group called INSTANCE_MANAGER and associate it with an IAM policy using the manage verb.
Authorization context
Permission Type: Permission Group
ext_permission: INSTANCE_MANAGER
ext_Customer_Code: 1070
IAM Policy
Allow any-user to manage instance-family in tenancy where all {
request.principal.type = 'identityfederateddomainapp',
request.principal.ext_permission = 'INSTANCE_MANAGER',
target.resource.compartment.tag.Customer.Customer_Code = request.principal.ext_Customer_Code
}
Unlike the previous examples, this policy does not restrict authorization to individual API operations.
The INSTANCE_MANAGER claim can satisfy the permission group condition for operations covered by manage instance-family, provided the other policy conditions match.
This is a broader permission scope, potentially appropriate for trusted management processes that need those capabilities.
These examples demonstrate how we can combine different levels of authorization granularity, from individual API operations to selected operation groups or broader resource management permissions.

Figure 4 — Authorization Scenarios. Expected Allow and Deny outcomes for Examples A, B, and C, considering the propagated permission claim, requested API operation, and target customer. The results assume no other applicable policies grant access.
The effective result of each request depends on all applicable OCI policies, the API operation, and the relevant authorization context.
4. Establishing Permission Boundaries
An important consideration is how to establish the maximum permission scope that can be granted through our IAM policies.
This is especially relevant when we compare an external permission claim directly with the requested OCI operation:
request.principal.ext_permission = request.operation
Although this condition allows dynamic authorization based on the operation represented in the RPST, we should avoid relying exclusively on the external claim to determine the available privileges.
Consider a policy using manage all-resources combined with this condition.
Depending on the operation included in the token, such a policy could potentially authorize actions across different OCI resource families.
Even when we trust the external system to issue the appropriate claims, it is preferable to establish explicit limits within OCI IAM.
Instead of using manage all-resources, we can create separate policy statements covering specific resource families, such as instance-family, virtual-network-family, or object-family, with appropriate verbs and conditions.
This may require additional IAM policy statements, but it ensures that operations outside the scope of those statements cannot be authorized through them, regardless of the value contained in the external permission claim.
The external claim defines the requested authorization context. The OCI IAM statement establishes the resource types and permission scope within which that context can be evaluated.
This separation is particularly useful for maintaining explicit boundaries without losing the flexibility of dynamic authorization.
It is important to remember that restrictive conditions in one Allow statement do not create a global permission boundary. Other applicable IAM policies may independently grant broader permissions to the same principal.
To enforce restrictions across multiple applicable Allow policies, OCI IAM Deny policies can be used to explicitly prevent specific actions, as Deny policies take precedence over Allow policies.
For details, refer to OCI IAM Deny Policies.
5. Where to Place IAM Policies in the Compartment Hierarchy
Another important consideration is where to define the IAM policies.
Since our model needs to support multiple customer compartments, we do not want to create and maintain the same statements separately for every customer.
OCI IAM policies can cover a parent compartment and its descendants. This allows us to define a shared set of authorization policies at a higher level of the compartment hierarchy.
For example:
ROOT
├── Customers
│ ├── Customer-1070
│ │ ├── Production
│ │ └── Development
│ └── Customer-2080
│ └── Production
├── Security
├── Networking
└── Operations
Here, Customers is the parent compartment for resources managed by the worker.
We can define a shared IAM policy at this level, using a statement such as:
Allow any-user to manage instance-family in compartment Customers where all {
request.principal.type = 'identityfederateddomainapp',
request.principal.ext_permission = 'INSTANCE_MANAGER',
target.resource.compartment.tag.Customer.Customer_Code = request.principal.ext_Customer_Code
}
The policy’s resource scope covers Customers and its descendant compartments.
The propagated customer identifier must still match the tag associated with the target compartment or an applicable ancestor in its hierarchy.
For example, an RPST containing:
ext_Customer_Code = 1070
can satisfy the customer condition for resources within the Customer-1070 hierarchy when that parent compartment is tagged with:
Customer.Customer_Code = 1070
provided the other policy requirements are met.
The policy does not need to be duplicated for every customer. New customer compartments can be incorporated into the same authorization structure when their resource organization and tags follow the established model.
In this example, we use the compartment name Customers to define the policy scope.

Figure 5 — Centralized IAM Policies Across Customer Compartments. The resource scope defined by in compartment Customers covers Customers and its descendants. The customer tag condition further restricts authorization to the corresponding customer hierarchy. Security, Networking, and Operations are outside this resource scope.
This structure allows the same set of policies to serve multiple customers without requiring the policy count to grow proportionally with the number of customer compartments.
6. What This Changes in Practice
The main difference is how the authorization model scales.
In an architecture based on permanent OCI users, additional customers and permission profiles may require additional identities, group memberships, and potentially more policy administration.
With JWT-to-RPST, the customer and permission context can be carried through token sessions and evaluated by a shared set of IAM policies.
The model separates three responsibilities:
- The external SaaS platform determines the authorized customer context and operation.
- The RPST carries the selected claims.
- OCI IAM enforces the permitted operations and resource boundaries.
The design avoids the need to create permanent OCI users for each customer and permission profile. The number of policy statements depends primarily on the authorization requirements, OCI resource families, and operations involved, rather than growing proportionally with the number of customers.
7. Security Considerations and Additional Controls
The authorization model still depends on several security controls.
Trust in the external identity system: The JWT issuer and the component responsible for creating authorization claims must be trusted. Customer identifiers and permissions should come from validated authorization decisions, not arbitrary input.
Token lifetime and Proof-of-Possession: RPSTs are temporary, but the validity period matters when external permissions change. The associated private key must also be protected, and token reuse or caching should be considered according to the workload requirements.
OCI IAM guardrails: Policies should remain as specific as possible. Other applicable policies must be considered when determining effective permissions. Where appropriate and supported, Deny policies can provide additional restrictions.
Tag governance: Since compartment tags are used to enforce customer isolation, control over their creation and modification becomes part of the security model. Tags should be managed through trusted administrative processes.
Auditing and monitoring: OCI API operations performed using the RPST should be monitored to support investigation and correlation with the external application context.
These controls complement the IAM policy model.
Final Thoughts
The challenge we faced was not simply authenticating an external SaaS application to OCI. It was extending an existing authorization model into OCI while preserving least privilege and customer isolation, without creating an operational burden that grows with every new customer.
JWT-to-RPST token exchange, combined with Identity Propagation Trust, compartment tags, and conditional IAM policies, provides a way to address this challenge.
The approach allows different levels of permission granularity, from individual API operations to permission groups, while maintaining explicit resource boundaries within OCI IAM.
The implementation described here is one possible model, developed from a real customer requirement and explored through a technical demonstration. Different applications may require other claims, resource mappings, policy structures, and additional controls.
The objective is to illustrate how an external authorization context can be evaluated within OCI IAM-defined boundaries, providing an alternative to architectures that depend on a growing inventory of permanent OCI identities.
For more information about implementing JWT-to-RPST and Identity Propagation Trust, explore the OCI documentation and technical references listed below.
References
- Workload Identity Federation with Ephemeral, Zero-Footprint Principal for Claims-Based Authorization
- OCI Workload Identity Federation using Ephemeral RPST
- Token Exchange Grant Type: Exchanging a JSON Web Token for a RPST
- Scoping Access with Permissions or API Operations
- Detailed Service Policy Reference
- Using Tags to Manage Access
- OCI IAM Deny Policies
