CLOUD CONCEPT

OpenID Connect

OpenID Connect is an identity protocol built on OAuth 2.0 that lets applications verify identities through a trusted identity provider.

Cloud Concepts Hub →

What is OpenID Connect

OpenID Connect (OIDC) standardizes authentication and identity claims so applications can rely on a shared identity provider instead of managing separate credentials. In cloud environments, it supports application sign-in and identity federation, including exchanges of trusted workload tokens for temporary cloud credentials.

OpenID Connect adds an authentication layer to OAuth 2.0. OAuth defines how clients obtain authorization to access resources, but OAuth alone does not standardize how a client learns who authenticated. OIDC introduces an ID token and standardized identity claims to address that gap. The identity provider, called the OpenID Provider, authenticates the user and issues tokens; the application, called the relying party, validates the identity information before establishing its own session.

An ID token is a JSON Web Token containing claims such as the issuer, subject, audience, and expiration time. The issuer identifies the provider, the subject identifies the principal within that issuer, and the audience identifies the intended recipient. Applications should generally identify users by the combination of issuer and subject rather than by email address, which can change or be reassigned. An ID token establishes identity for its intended client; it is not automatically an access token for an API or a credential for cloud management operations.

For interactive applications, the authorization code flow with Proof Key for Code Exchange, or PKCE, is the usual secure choice. An authentication request includes the openid scope. The application receives an authorization code and exchanges it for tokens. Implementations must validate the token signature using trusted provider keys, check the expected issuer and audience, enforce expiration, and validate the nonce when one was included in the request. Discovery metadata and JSON Web Key Sets help applications locate endpoints and obtain signing keys, but the expected issuer must come from trusted configuration rather than arbitrary user input.

Cloud federation extends this trust model to temporary infrastructure access. For example, a deployment job can receive an OIDC token from its CI platform and exchange it for temporary role credentials instead of storing a long-lived cloud access key. In AWS, an IAM OIDC identity provider represents the trusted issuer, an IAM role trust policy controls which token identities may assume the role, and AWS Security Token Service processes AssumeRoleWithWebIdentity. The role's permissions policies then determine what the resulting session can do.

A secure deployment configuration constrains both the audience and the subject. For a GitHub Actions deployment, the audience can be sts.amazonaws.com, while the subject identifies an approved repository and branch or protected environment. Trusting every subject from the issuer would allow unrelated workloads to attempt role assumption. At scale, define provider and role configurations through infrastructure as code, separate deployment roles by account and environment, and review federation activity alongside cloud API audit records.

Workforce federation and workload federation are related but not interchangeable. AWS IAM Identity Center centralizes workforce access across accounts through permission sets and supports external identity providers through SAML 2.0, with SCIM available for provisioning. It should not be treated as a generic inbound OIDC federation endpoint simply because it also exposes OIDC-based application authorization capabilities. Choose the integration based on the identity population, protocol support, and target resource.

OIDC reduces password duplication and static-secret exposure, but it creates dependencies on provider availability, signing-key management, and correct claim validation. Short token lifetimes limit exposure, yet disabling an upstream identity does not necessarily invalidate an already established application session or issued cloud credentials immediately. Federation also does not grant least privilege automatically: token acceptance, role authorization, session duration, and downstream permissions remain separate controls.

Key aspects of OpenID Connect

OIDC combines standardized identity tokens with explicit trust validation, enabling federated access without replacing downstream authorization controls.

Authentication built on OAuth 2.0

OIDC adds standardized authentication and identity claims to OAuth authorization flows. Use an ID token to establish identity for its intended client, not as a universal API credential.

Explicit issuer and audience trust

A valid signature alone is insufficient: the token must come from the expected issuer and target the intended audience. These checks prevent accepting otherwise legitimate tokens issued for a different provider relationship or application.

Stable identity through claims

The issuer and subject together identify a principal. In workload federation, supported subject conditions can restrict access to a particular repository, branch, environment, or service account.

Temporary credential federation

Cloud token services can exchange accepted OIDC tokens for short-lived role credentials. This removes the need to distribute static cloud keys, while leaving resource permissions under cloud authorization policies.

Standardized discovery and key rotation

Provider metadata and published signing keys support interoperable validation and key rotation. Clients must handle key refresh safely and reject tokens whose signatures or required claims cannot be validated.

Separate authentication and authorization controls

Successful authentication does not determine every action a principal may perform. Apply least-privilege role policies, narrow federation trust conditions, appropriate session lifetimes, and audit logging.

Cloud services for OpenID Connect

IAM and STS form the core AWS workload federation path: IAM defines the trusted OIDC issuer and role conditions, while STS exchanges an eligible token for temporary credentials. EKS service accounts can use this path through IAM roles for service accounts, and external CI systems can use it for deployment jobs. Cognito addresses application authentication and can connect identities to AWS access through identity pools. IAM Identity Center addresses centralized workforce access across accounts, but its external identity-provider integration uses SAML rather than the IAM OIDC provider mechanism. These integrations require distinct trust configurations even when they share the goal of avoiding separately managed credentials.

Amazon Cognito image Amazon Cognito

Cognito user pools act as OIDC providers for application sign-in and can federate users from external OIDC providers. Cognito identity pools can exchange supported identity tokens for temporary AWS credentials through IAM roles.

Open Amazon Cognito →