Federation and temporary identity
Why use federation?
Identity federation allows a cloud service to rely on identity information from another trusted system. Instead of creating a separate password or permanent access key for every employee or program, an organization can authenticate identities at an identity provider (IdP) and exchange trusted evidence for limited cloud access. Authentication establishes who is making a request; authorization determines what that principal may do. Federation solves part of the authentication and delegation problem, not every authorization problem.
Imagine a bookstore whose release pipeline needs to publish one build artifact. Its workload should obtain a short-lived credential for the artifact repository, not a shared administrator key. A human engineer needs a different identity and may require approval for production changes. Separating identities makes it easier to attribute requests, restrict permissions and remove access when a job or employment relationship ends.
Follow the trust exchange
A workforce identity represents a person; a workload identity represents an application, service or automated job. A trust relationship tells the receiving identity system which external identity evidence it is prepared to accept. Security Assertion Markup Language (SAML) uses signed XML assertions and is common in enterprise single sign-on. OpenID Connect (OIDC) adds identity information to OAuth 2.0 and commonly uses signed ID tokens. An ID token describes authentication to its intended relying party; it is not automatically an access token for a cloud API.
Workload or person -> trusted IdP -> signed evidence -> cloud identity / token exchange -> temporary credential -> target API -> permission evaluation -> resultA verifier checks cryptographic authenticity, trusted issuer, intended audience, expiry and relevant subject or attribute restrictions. A claim is a statement about the identity or context. The issuer identifies the source, the subject identifies the represented identity in that issuer's context, and the audience identifies an intended recipient. A correctly signed token from the wrong issuer or for the wrong audience should not satisfy the configured trust. Use supported libraries and provider mechanisms; never decode an unsigned claim and treat it as verified.
The exchanged credential can have a different audience and expiry from the source evidence. Avoid logging either. Use supported refresh mechanisms before expiry, store credentials only as long as needed, and distinguish removing trust for future exchanges from invalidating credentials already issued.
Worked example: a release job
All times are fictional UTC, with an ideal clock and no clock-skew allowance. A release job gets an assertion at 09:00 that expires at 09:05. It exchanges the assertion at 09:02 for a 15-minute cloud session, expiring at 09:17. At 09:06 the original assertion is expired, but the cloud session may still be usable if it has not been revoked and permissions still allow the action. At 09:17 the model treats the cloud session as expired. These durations are illustrative, not provider defaults or promises.
Trust is restricted to the approved release workflow and environment. The job receives permission to publish artifacts only in the bookstore repository. A test job does not receive production rights even if it uses the same IdP. Do not equate a repository name, email or other mutable display label with an immutable identity; select verified stable attributes appropriate to the provider. A short session limits the lifetime of a leaked credential but does not prevent misuse during that lifetime.
Compare AWS, Azure and Google Cloud
AWS: IAM roles define assumable identities with trust and permission policies. AWS STS can issue temporary credentials after a supported federation or role assumption request. OIDC and SAML federation are supported in appropriate configurations; IAM Identity Center is a workforce access option. The trust policy governs who may assume a role; the role's permissions and applicable guardrails govern API access. A role is not just a list of permissions.
Azure: Microsoft Entra ID authenticates identities and issues tokens for intended resources. Azure RBAC grants Azure resource access through assignments at a scope. A managed identity is a workload identity whose credential management is handled by Azure in supported services. Federated identity credentials for supported applications and user-assigned managed identities establish trust in external tokens, matching issuer, subject and audience as documented. A managed identity still needs resource permissions. Microsoft Entra directory roles are distinct from Azure resource roles.
Google Cloud: workforce federation addresses external human identities; workload identity federation addresses external software. A workload identity pool and provider map and restrict incoming identities. In supported cases, grant the federated principal access directly or use a specifically authorized service account impersonation flow. A service account is an identity, not merely a permission bundle. IAM roles grant permissions to principals through policy bindings. Do not equate an AWS role, an Azure role definition and a Google Cloud IAM role.
Review, rotate and recover
Maintain an inventory of trusted issuers, identities, authorized scopes, session duration, owners and last review. Remove dormant grants after confirming dependencies; review privileged access regularly and use time-limited elevation where suitable. Audit token exchanges and resource operations without retaining credentials in logs. Correlate requests with synthetic or redacted identities and request IDs. Credential rotation includes updating dependencies, testing new credentials and revoking old ones; do not assume all tokens become unusable instantly.
Emergency access (break-glass) is a governed recovery path for identity-system failures. Define authorized custodians, strong authentication, independent recovery dependencies, monitoring, periodic safe testing and post-use review. Provider-specific guidance determines account configuration. Do not make a broad permanent administrator grant the default for ordinary work.
Practice and next step
Trace the bookstore release assertion and session separately. Identify the IdP, trust restriction, cloud identity and allowed resource operation. Explain why valid evidence does not grant administrator access. Use the manual task and knowledge check; no account or credential is needed. Next, evaluate permission decisions under different provider models. References: Federation and temporary identity; official AWS temporary credential, Microsoft Entra federation and Google Cloud workload federation documentation in the evidence register.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Federation and temporary identity — knowledge check
Choose the best answer for each offline scenario.
What does federation establish?
A session starts at 09:02 and lasts 15 minutes. When does it expire in the model?
Which token should fail the configured trust check?
What is the role of a managed identity?
What is an appropriate emergency access practice?