# AWS OIDC Authentication with SPIFFE

DevFeed: [AWS OIDC Authentication with SPIFFE](<https://devfeed.tech/articles/aws-oidc-authentication-with-spiffe-15540.md>)

Original publisher: [Read original article](<https://developer.squareup.com/blog/aws-oidc-authentication-with-spiffe>)

Author: Roy Xu

Published: 2021-08-26T19:00:00Z

Content type: article

Language: en

Sources: [Square Corner](<https://devfeed.tech/sources/square-corner-blog-medium.md>)

Topics: [OpenID connect (OIDC)](<https://devfeed.tech/topics/oidc.md>), [SPIFFE](<https://devfeed.tech/topics/spiffe.md>), [SPIRE](<https://devfeed.tech/topics/spire.md>), [Amazon Web Services](<https://devfeed.tech/topics/aws.md>), [AWS IAM](<https://devfeed.tech/topics/aws-iam.md>), [AWS Security Token Service](<https://devfeed.tech/topics/aws-security-token-service.md>), [Authentication](<https://devfeed.tech/topics/authentication.md>), [Access Control](<https://devfeed.tech/topics/access-control.md>), [Secure token management](<https://devfeed.tech/topics/secure-token-management.md>), [data centers](<https://devfeed.tech/topics/data-centers.md>), [certificates](<https://devfeed.tech/topics/certificates.md>)

Tags: [authentication](<https://devfeed.tech/tags/authentication.md>), [aws](<https://devfeed.tech/tags/aws.md>), [credentials](<https://devfeed.tech/tags/credentials.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [oidc](<https://devfeed.tech/tags/oidc.md>), [spiffe](<https://devfeed.tech/tags/spiffe.md>)

## AI overview

Square describes replacing long-lived AWS access keys stored in Keywhiz with short-lived credentials issued through OIDC federation between SPIRE identities and AWS roles. App owners create OIDC-compatible roles with Terraform modules and add a role ARN to their P2 manifest; a generated credentials file invokes `spiffe-aws-assume-role` through the AWS SDK's `credential_process`. The tool requests a signed JWT from the local SPIRE agent and exchanges it with AWS STS. Square publishes SPIRE JWKS and OIDC metadata by syncing them to S3 and serving them through CloudFront, improving availability and avoiding per-request calls into its datacenter. Tokens use the AWS account ID as audience to limit use of a stolen token to that account; the article notes a token could still access other roles available to the app there. Square reports the system reached general availability and app migrations were proceeding smoothly.

## Source excerpt

Easy authentication with automated AWS credentials