Skip to main content
Public Preview If an administrator has connected your AWS account to your 1Password Business account, you can use 1Password to access secrets from your 1Password Environments in AWS applications at runtime. Your application uses its IAM role to request a short-lived OIDC token from AWS STS. It passes that token to the 1Password JavaScript SDK, along with its 1Password workload ID and integration key, and 1Password verifies the token before returning secrets from your Environment. You don’t need to create an IAM OIDC identity provider or allow sts:AssumeRoleWithWebIdentity. This page uses AWS Lambda as the primary example. Other AWS application types can use the same OIDC flow with their own service-specific execution role and application configuration.

Step 1: Set up an Environment

To configure the variables you need to use in an AWS application, make sure you have the latest version of the 1Password desktop app, then create a new 1Password Environment with your secrets or add your secrets to an existing Environment.

Step 2. Connect your Environment to an AWS IAM workload

After you’ve set up an Environment and added your secrets, you can connect the Environment to an AWS IAM workload:
  1. Open your Environment, then select Connect in the AWS IAM section.
    If you’ve already connected your Environment to a workflow, select ”+ Connect” to add an additional workload, then select Connect in the AWS IAM section.
  2. Enter a name for your workload, then choose the integration for the AWS account you need.
  3. Enter the ARN of the IAM role your workload uses, for example arn:aws:iam::123456789012:role/example-lambda-role. Use the role ARN, not an assumed-role ARN or a Lambda function ARN.
  4. (Optional) Define any additional access conditions you want to enforce, like a specific Lambda function ARN or principal tags.
  5. Select Add workflow.
  6. Make note of the workload ID and Environment ID. You’ll need them in your workload’s configuration.
Use separate IAM roles, application registrations, and Environments for development, staging, and production. If you require separate integration keys, create separate integrations for those environments. Restrict each role to the exact audience for its environment.

Step 3: Allow your application’s role to request an OIDC token

Your application’s IAM role needs permission to call sts:GetWebIdentityToken for the audience your administrator configured. Add a policy like this to the role, replacing <expected-audience> with the exact audience value:
sts:GetWebIdentityToken doesn’t support resource-level permissions, so Resource must be "*". The audience and duration conditions limit what the role can request. For Lambda, keep the standard Lambda execution-role trust relationship with lambda.amazonaws.com. Other AWS application types should use their normal service trust relationship. If you retrieve the integration key from AWS Secrets Manager at runtime, the application role also needs permission to call secretsmanager:GetSecretValue for that specific secret. If the secret uses a customer-managed KMS key, the role may also need the corresponding kms:Decrypt permission. These permissions are separate from sts:GetWebIdentityToken.

Step 4: Use your Environment in your application

After you’ve connected your Environment, create a 1Password SDK client configured with a function that fetches an OIDC token from AWS STS. The client authenticates using that token, your 1Password workload ID, and the integration key configured by your administrator, then retrieves secrets from your Environment using the Environment ID.
1Password Credential Broker is only supported in the 1Password JavaScript SDK at this time.
Configure these environment variables for your application:

Usage example

The following example shows how you can use a 1Password JavaScript SDK client in an AWS Lambda function to load an API token from your Environment, then use it to call an external API. Before you run the example, install the dependencies:
1Password SDK client example
Lambda handler example
To deploy the example:
  • Use the Lambda execution role you connected in step 2, with the policy from step 3.
  • Configure the four environment variables on the function. This example reads the integration key from an environment variable for simplicity. You can also retrieve it at runtime from wherever your administrator stored it, like AWS Secrets Manager.
  • Package @1password/sdk and @aws-sdk/client-sts with the function, or provide them through a Lambda layer. The AWS SDK version included in the Lambda runtime may not support GetWebIdentityTokenCommand.
  • Don’t log the OIDC token, the integration key, or any secret values.

Get help

If you don’t see AWS IAM as a destination in the 1Password desktop app, make sure your administrator has connected your AWS account to your 1Password account. If AWS STS returns AccessDenied, make sure outbound identity federation is enabled for your AWS account, your role has the policy from step 3, and the audience you request exactly matches the policy. An organization service control policy (SCP) can also deny the action. If 1Password rejects the request, make sure the role ARN you connected in step 2 matches the role your application runs as, the audience matches exactly, and your 1Password workload ID and integration key come from the same integration. If your Lambda function times out and is attached to a VPC, make sure it has an outbound path to AWS STS and the 1Password API.

Learn more