Kokil Thapa - Professional Web Developer in Nepal
Freelancer Web Developer in Nepal with 15+ Years of Experience

Kokil Thapa is an experienced full-stack web developer focused on building fast, secure, and scalable web applications. He helps businesses and individuals create SEO-friendly, user-focused digital platforms designed for long-term growth.

Identity Federation Across AWS, Azure, and GCP

By Kokil Thapa | Last reviewed: September 2026

Identity federation across AWS, Azure, and GCP is how you let humans, services, and CI jobs prove who they are without copying long-lived access keys into every repo. On a production Laravel app that talks to S3, Azure Blob, and Cloud Storage, static credentials rot slowly, leak quietly, and break audits. Federation replaces them with trust relationships: your corporate IdP or one cloud's OIDC issuer vouches for a caller, and the target cloud issues short-lived credentials. This guide maps the models, config paths, and production traps I've seen while wiring workload identity federation without long-lived keys on real client stacks.

What is identity federation across AWS, Azure, and GCP?

Identity federation means an external party authenticates a subject, and a cloud platform accepts that proof to grant access. AWS calls federated principals IAM roles fed by SAML 2.0 or OIDC. Azure maps them through Microsoft Entra ID (formerly Azure AD) and federated credentials. GCP uses Workload Identity Federation to trust external OIDC or SAML issuers.

The pattern is the same on every cloud: establish trust, map claims to a local identity, issue scoped credentials. What differs is naming, default session length, and how tightly each vendor couples to its own IdP. For teams running PHP on GCP vs AWS vs Azure for PHP workloads, federation is often the first security fix after migration.

Multi-Cloud Identity FederationCorporate IdPEntra ID / Okta / GoogleAWS IAMRoles + STS tokensAzure RBACManaged identitiesGCP IAMWIF + SA tokensApps, CI pipelines, and VMsShort-lived credentials only
Identity federation across AWS, Azure, and GCP: one IdP vouches for callers; each cloud maps claims to local IAM roles.

Three federation layers matter in practice:

  • Human federation — staff sign in via SAML/OIDC; clouds map groups to roles. Common for console and CLI access.
  • Workload federation — GitHub Actions, GitLab CI, or a VM identity exchanges an OIDC token for cloud credentials. No keys in git.
  • Cross-cloud federation — a service in AWS assumes a role in GCP via WIF, or Azure trusts AWS OIDC for pipeline deploys. Harder, but avoids duplicate secret stores.

On legal-tech portals I've maintained, document uploads hit object storage in one cloud while the app runs elsewhere. Federation keeps those integrations auditable. See our Mijar Law Associates client portal class of systems where RBAC and external storage must align.

How does OIDC workload identity federation work without long-lived keys?

OIDC federation is the default for CI/CD in 2026. Your pipeline requests a JWT from its platform issuer. The target cloud validates signature, audience, and subject, then returns temporary credentials scoped to one role.

AWS documents this as web identity federation via AssumeRoleWithWebIdentity. GCP packages it as Workload Identity Federation. Azure exposes federated identity credentials on app registrations and managed identities, described in Microsoft's workload identity federation guide.

AWS: GitHub Actions to IAM role

Create an OIDC provider, then trust it from a role:

aws iam create-open-id-connect-provider \
  --url https://token.actions.githubusercontent.com \
  --client-id-list sts.amazonaws.com \
  --thumbprint-list 6938fd4d98bab03faadb97b34396831e3780aea1

# Trust policy snippet (attach to role)
{
  "Effect": "Allow",
  "Principal": { "Federated": "arn:aws:iam::ACCOUNT:oidc-provider/token.actions.githubusercontent.com" },
  "Action": "sts:AssumeRoleWithWebIdentity",
  "Condition": {
    "StringEquals": {
      "token.actions.githubusercontent.com:aud": "sts.amazonaws.com"
    },
    "StringLike": {
      "token.actions.githubusercontent.com:sub": "repo:org/app:ref:refs/heads/main"
    }
  }
}

In GitHub Actions, request the role with aws-actions/configure-aws-credentials. Session tokens expire in one hour by default. Rotate nothing manually.

GCP: GitLab CI to service account

Define a workload identity pool and provider, then bind IAM:

gcloud iam workload-identity-pools create "gitlab-pool" \
  --location="global" \
  --display-name="GitLab CI Pool"

gcloud iam workload-identity-pools providers create-oidc "gitlab-provider" \
  --location="global" \
  --workload-identity-pool="gitlab-pool" \
  --issuer-uri="https://gitlab.com" \
  --attribute-mapping="google.subject=assertion.sub,attribute.project_path=assertion.project_path"

# Allow GitLab project to impersonate SA
gcloud iam service-accounts add-iam-policy-binding \
  SA_NAME@PROJECT.iam.gserviceaccount.com \
  --role="roles/iam.workloadIdentityUser" \
  --member="principalSet://iam.googleapis.com/projects/PROJECT/locations/global/workloadIdentityPools/gitlab-pool/attribute.project_path/mygroup/myapp"

Your pipeline calls gcloud auth login --cred-file or uses the google-github-actions/auth action pattern. Tokens last minutes to hours depending on config.

Azure: federated credential on managed identity

az identity federated-credential create \
  --name "github-main" \
  --identity-name "deploy-uami" \
  --resource-group "prod-rg" \
  --issuer "https://token.actions.githubusercontent.com" \
  --subject "repo:org/app:ref:refs/heads/main" \
  --audiences "api://AzureADTokenExchange"

Azure DevOps and GitHub both support this path. Pair it with Azure Key Vault secrets in pipelines so deploy scripts never touch plaintext secrets.

OIDC Workload Federation FlowCI JobGitHub / GitLabOIDC IssuerSigns JWTCloud IAMValidates claimsSTS Token1 hour TTLJWT claims: iss, aud, sub, repository, refAWS STSAssumeRoleWithWebIdentityAzure ADFederated credentialGCP WIFGenerateAccessToken
OIDC workload identity federation: CI obtains a signed JWT, exchanges it for short-lived cloud credentials.

How do you configure cross-cloud identity federation step by step?

Cross-cloud federation means Cloud A trusts Cloud B's OIDC issuer, or both trust one corporate IdP. Start simple: one IdP, three cloud apps, group-based role mapping. Add cross-cloud only when a workload in one vendor must call APIs in another without a shared secret.

  1. Inventory identities — list humans, CI pipelines, VMs, and Lambda/Cloud Functions that currently use static keys. Use a password and secret hygiene checklist to flag embedded credentials in env files.
  2. Pick a canonical IdP — Microsoft Entra ID, Okta, or Google Workspace for staff. For machines, prefer each CI platform's native OIDC issuer over inventing your own.
  3. Configure SAML/OIDC apps per cloud — AWS IAM Identity Center, Entra enterprise apps, GCP Workforce Identity Federation for human access. See AWS IAM Identity Center documentation for the AWS side.
  4. Map groups to roles — never map individual users at scale. Use groups or roles claims consistently.
  5. Enable workload pools — WIF on GCP, OIDC providers on AWS, federated credentials on Azure for each pipeline.
  6. Remove static keys — delete access keys after parity testing. Monitor CloudTrail, Azure Activity Log, and GCP Audit Logs for AssumeRole failures.
  7. Document break-glass — one emergency local admin per cloud, stored offline, with MFA enforced.

SAML for enterprise staff access

SAML 2.0 remains the enterprise default for browser SSO. Entra ID publishes metadata XML; AWS IAM Identity Center consumes it; GCP Workforce Identity Federation accepts third-party IdP SAML assertions. Attribute mapping must align:

# AWS Identity Center attribute mapping (conceptual)
Subject      = user.userprincipalname
email        = user.mail
groups       = user.groups

Mismatch on groups is the top reason federated users land in the wrong permission set. Test with a single pilot group before cutover.

Cross-cloud: AWS Lambda calling GCP APIs

Configure GCP WIF to trust AWS STS as an OIDC issuer (via a custom OIDC wrapper) or use a small token-exchange service. In practice, many teams run a thin API gateway layer in one cloud that holds federation logic, so application code stays dumb HTTP.

On a production Laravel application, I've used this pattern: the app runs on AWS EC2 with an instance profile; GCP access goes through WIF from GitLab CI for deploy-time tasks only. Runtime cross-cloud calls route through signed internal APIs instead of chaining federation twice.

Cross-Cloud Federation Setup1. InventoryFind static keys2. IdP trustSAML / OIDC3. Map rolesGroups to IAM4. WIF poolsCI workloads5. CutoverRevoke keysMonitoring after cutoverCloudTrailAssumeRole eventsAzure ActivitySign-in logsGCP AuditToken grantsAlert on failed federation or stale key usagePair with AWS Secrets Manager and Azure Key Vault rotation
Step-by-step cross-cloud identity federation: inventory keys, establish trust, map roles, enable workload pools, then monitor.

Which identity federation model should you choose for multi-cloud apps?

Pick the model that matches your caller type and audit requirements. The table below compares what each cloud offers in 2026 for common scenarios.

ScenarioAWSAzureGCPRecommended pattern
Staff console SSOIAM Identity Center + SAML/OIDCEntra ID nativeWorkforce Identity FederationSingle corporate IdP; map groups centrally
GitHub Actions deployOIDC → IAM roleFederated credential on UAMIWIF pool + SA impersonationOIDC per repo branch; least privilege role
VM / EC2 workloadInstance profile (IMDSv2)System-assigned managed identityAttached service account (GCE/GKE)Native identity first; no keys on disk
Kubernetes podsEKS IRSAAKS workload identityGKE Workload IdentityOIDC trust to cluster issuer
Cross-cloud API callAssumeRole via custom brokerToken exchange + MIWIF external issuerInternal API broker; avoid chained trust
Legacy SAML appsSAML 2.0 federationEntra SAML SSOWorkforce SAMLSAML for humans; OIDC for machines

For PHP and Laravel teams choosing a primary cloud, read AWS vs Azure vs Google Cloud in 2026 first. Federation complexity rises with vendor count, not language. A single-cloud app with WIF beats a tri-cloud mesh nobody can debug.

Budget matters too. Federation itself is cheap; misconfigured roles are expensive. Nepali startups often spread workloads across vendors for cost — see budgeting AWS and Azure in NPR — but identity should stay centralized even when compute is split.

Secret storage still has a place. Federation handles authentication; AWS Secrets Manager and Azure Key Vault hold database passwords and third-party API keys that no IdP should issue. Encrypt those with KMS — our AWS KMS envelope encryption guide covers the pattern.

What are common identity federation mistakes in production?

These failures show up on every audit and every 2 a.m. deploy page.

Over-broad trust policies

A trust policy that says StringLike: sub = repo:org/* lets any repository in the org assume production roles. Scope to branch and environment: repo:org/app:environment:production on GitHub, or GitLab protected branches only.

Mixing human and workload trust

Do not attach CI federation to the same role developers use for console access. Split deploy-role-prod from developer-readonly. I've seen a pipeline compromise become a full account takeover when those roles merged.

Ignoring token audience and issuer drift

CI platforms rotate OIDC thumbprints and issuer URLs. Pin AWS thumbprints, but monitor provider health. A failed deploy after a GitHub infrastructure change is often a stale OIDC provider config.

Leaving break-glass keys in .env

Federation does not remove Laravel .env secrets for MySQL or Redis. It removes cloud vendor keys. After enabling WIF, grep repos for AKIA, azure_client_secret, and GCP JSON key files. Store remaining secrets in vaults, not git.

Skipping audit correlation

Each cloud logs federation differently. Ship CloudTrail, Azure sign-in logs, and GCP audit logs to one SIEM or at least one S3 bucket. Correlate by subject claim and pipeline run ID.

Federation Trust Policy: Wrong vs RightWrong: Broad trustsub = repo:org/*Any repo assumes prodShared human + CI roleRight: Scoped trustsub = repo:org/app:ref:mainBranch + env conditionsSeparate deploy rolesProduction checklistMFA on IdP · No static keys · Audit logs centralizedBreak-glass account offline · Quarterly trust review
Common identity federation mistake: over-broad OIDC subject matching versus scoped branch-level trust policies.

Infrastructure-as-code helps keep trust policies reviewable. Terraform modules in deploy the same app to AWS and Azure with Terraform let you diff IAM changes in pull requests. Pair with Azure DevOps or GitLab CI pipelines that assume federated roles — never embed keys in YAML.

For user-facing auth on apps — logins, not cloud IAM — keep concerns separate. AWS Cognito for user authentication serves application users; Entra ID B2C or Laravel Sanctum serves others. Cloud federation governs who can deploy and operate infrastructure, not who buys flowers or books a notary slot.

Laravel App: Two Identity LayersApplication layer (users)Sanctum / Cognito / Entra B2C — session cookies for customersLaravel 13PHP 8.3+ on EC2/AKS/GKES3 / BlobInstance profile / WIFRDS / Cloud SQLSecrets ManagerOperations layer (cloud IAM)OIDC federation for CI deploy · No AKIA keys in .env
Identity federation across AWS, Azure, and GCP for Laravel: separate end-user auth from cloud IAM federation for operations.

Teams building booking platforms like Adventure Third Pole Trek often start on one VPS, then split storage to object storage when uploads grow. Federation makes that split safe. Our enterprise application development and custom software development engagements typically include an identity review before any multi-cloud cutover.

Ongoing ops belong in runbooks. After federation goes live, schedule quarterly trust-policy reviews with support and maintenance coverage. Server hardening — IMDSv2 on AWS, managed identities on Azure — pairs with Linux system administration baselines.

Key Takeaways

  • Identity federation across AWS, Azure, and GCP replaces long-lived keys with OIDC or SAML trust and short-lived STS tokens.
  • Use corporate IdP federation for staff, native workload identity for CI, and instance profiles or managed identities for VMs — never mix deploy and human roles.
  • Scope OIDC trust policies to repository, branch, and environment; audit CloudTrail, Azure Activity Log, and GCP Audit Logs after cutover.
  • Keep application user auth (Sanctum, Cognito) separate from cloud IAM federation; they solve different problems.
  • Store database and API secrets in Secrets Manager or Key Vault; federation does not eliminate all secrets, only cloud vendor keys.
  • Start single-cloud WIF, add cross-cloud brokers only when needed, and codify IAM in Terraform pull requests.

People Also Ask

What is the difference between SAML and OIDC for cloud federation?

SAML 2.0 uses XML assertions and browser POST flows; it dominates enterprise staff SSO. OIDC uses JSON Web Tokens and fits CI pipelines, mobile apps, and service-to-service calls. Most 2026 architectures use SAML for humans and OIDC for machines.

Can one identity provider federate to AWS, Azure, and GCP at once?

Yes. Microsoft Entra ID, Okta, and Google Workspace all publish SAML and OIDC metadata that each cloud consumes. Map IdP groups to cloud-specific roles in IAM Identity Center, Entra app roles, and GCP Workforce Identity Federation respectively.

Do I still need service account keys after enabling workload identity federation?

No for CI and native compute identities. Delete GCP JSON keys, AWS access keys, and Azure client secrets once federated paths are tested. Keep break-glass credentials offline and rotate them on a fixed schedule separate from federation tokens.

How does identity federation affect Laravel deployments on multiple clouds?

Laravel apps keep using .env for app secrets but should obtain cloud storage and queue credentials from instance metadata or WIF at runtime. Deploy pipelines assume federated roles to run migrations and sync assets without storing vendor keys in GitLab or GitHub.

Ship multi-cloud identity federation with confidence

Identity federation across AWS, Azure, and GCP is not a one-time checkbox. It is an operating model: central IdP trust, scoped workload pools, no static keys in repos, and audit logs you actually read. Start with the pipeline that deploys your app, then expand to staff SSO and cross-cloud APIs only where business logic demands it.

If you are planning a multi-cloud cutover or cleaning up leaked cloud keys on a live system, contact us for a practical federation review. You can also browse the portfolio for examples of production apps that run secure document and booking workflows, or read more on the blog about cloud architecture for PHP teams.

Frequently Asked Questions

An external party authenticates a subject, and each cloud accepts that proof to grant access. AWS uses IAM roles fed by SAML 2.0 or OIDC, Azure maps through Microsoft Entra ID and federated credentials, and GCP uses Workload Identity Federation. The pattern is identical everywhere: establish trust, map claims to a local identity, issue scoped short-lived credentials.

SAML 2.0 uses XML assertions and browser POST flows; OIDC uses JSON Web Tokens. SAML dominates enterprise staff SSO; OIDC fits CI pipelines, mobile apps, and service-to-service calls. Most 2026 architectures use SAML for humans and OIDC for machines.

Federation itself is cheap. Misconfigured roles that grant excessive access or fail audits are what get expensive.

Yes. Microsoft Entra ID, Okta, and Google Workspace publish SAML and OIDC metadata that each cloud consumes. Map IdP groups to cloud-specific roles in AWS IAM Identity Center, Entra app roles, and GCP Workforce Identity Federation respectively. Start with one corporate IdP and three cloud apps rather than chaining multiple trust paths. Group-based mapping scales; mapping individual users does not. Identity should stay centralized even when compute is split across vendors for cost reasons.

Your pipeline requests a JWT from its platform issuer, such as GitHub Actions or GitLab CI. The target cloud validates signature, audience, and subject, then returns temporary credentials scoped to one role. On AWS this is AssumeRoleWithWebIdentity; on GCP it is Workload Identity Federation; on Azure it is federated identity credentials on app registrations or managed identities. Nothing rotates manually in git. Session tokens on AWS expire in one hour by default; GCP tokens last minutes to hours depending on configuration.

Create an OIDC provider pointing at token.actions.githubusercontent.com with client ID sts.amazonaws.com, then attach a trust policy allowing sts:AssumeRoleWithWebIdentity. Scope the subject condition to repo, branch, and environment, for example repo:org/app:ref:refs/heads/main, not repo:org/*. In the workflow, use aws-actions/configure-aws-credentials to request the role. Pin the OIDC thumbprint but monitor provider health, because CI platforms occasionally rotate issuer metadata and stale config breaks deploys without any application code change.

Create a workload identity pool and OIDC provider with issuer https://gitlab.com, map attributes such as google.subject and attribute.project_path from the assertion, then bind roles/iam.workloadIdentityUser on the target service account to a principalSet scoped by project path. The pipeline calls gcloud auth login --cred-file or follows the google-github-actions/auth pattern. This removes GCP JSON key files from repositories. Test on a protected branch before granting production impersonation rights, matching GitLab protected-branch rules to IAM bindings.

Run az identity federated-credential create against a user-assigned managed identity, setting issuer to https://token.actions.githubusercontent.com, subject to your repo and branch, and audience to api://AzureADTokenExchange. Azure DevOps and GitHub Actions both support this path. Pair federated deploy access with Azure Key Vault for database passwords and third-party API keys so pipeline scripts never touch plaintext secrets. Keep deploy roles separate from roles developers use for console access.

Inventory every human, CI pipeline, VM, and serverless function still using static keys. Pick a canonical IdP for staff and each CI platform native OIDC issuer for machines. Configure SAML or OIDC apps per cloud, map groups to roles at scale, enable workload pools on GCP, OIDC providers on AWS, and federated credentials on Azure. Delete access keys only after parity testing. Monitor CloudTrail, Azure Activity Log, and GCP Audit Logs for AssumeRole failures. Document one break-glass emergency admin per cloud with MFA, stored offline.

Match the model to caller type. Staff console SSO: IAM Identity Center plus SAML on AWS, native Entra ID on Azure, Workforce Identity Federation on GCP, all fed by one corporate IdP. GitHub Actions deploys: OIDC to an IAM role, federated credential on a UAMI, or a WIF pool with service account impersonation. VM workloads: instance profiles with IMDSv2, system-assigned managed identities, or attached GCE service accounts. Kubernetes: EKS IRSA, AKS workload identity, or GKE Workload Identity. Cross-cloud API calls: prefer an internal API broker over chained trust when possible.

Over-broad trust policies that let any repo in an org assume production roles. Mixing human and workload trust on one role, which turns a pipeline compromise into account takeover. Ignoring OIDC audience and issuer drift after CI platform infrastructure changes. Leaving AKIA keys, azure_client_secret values, and GCP JSON keys in .env after federation cutover. Skipping audit correlation across CloudTrail, Azure sign-in logs, and GCP audit logs. Fix these by scoping subjects to branch and environment, splitting deploy and developer roles, and shipping logs to one SIEM or bucket.

No. Do not attach CI federation to the same role developers use for console access. Split deploy-role-prod from developer-readonly. I've seen a pipeline compromise become full account takeover when those roles merged. Human federation via SAML serves staff signing into consoles and CLI tools. Workload federation via OIDC serves GitHub Actions, GitLab CI, and VM identities. Different callers, different blast radius, different audit trails. Quarterly trust-policy reviews should treat these as separate identity classes even when the same team owns both.

Federation removes cloud vendor access keys, not every secret. After enabling workload identity, grep repositories for AKIA prefixes, azure_client_secret, and GCP JSON key files and migrate survivors to AWS Secrets Manager or Azure Key Vault. Database passwords, Redis credentials, and third-party API keys still belong in vaults, not git. On production Laravel applications talking to S3, Azure Blob, and Cloud Storage, federation keeps storage integrations auditable while .env retains application-layer secrets encrypted with KMS where appropriate.

Add cross-cloud trust only when a workload in one vendor must call APIs in another without a shared secret. In practice, many teams run a thin API gateway in one cloud holding federation logic so application code stays plain HTTP. On a production Laravel app I've used EC2 instance profiles for AWS runtime while GCP access goes through WIF from GitLab CI for deploy-time tasks only. Runtime cross-cloud calls route through signed internal APIs instead of chaining federation twice. A single-cloud WIF setup beats a tri-cloud mesh nobody can debug.

They solve different problems. Cloud federation governs who can deploy and operate infrastructure: staff SSO, CI pipelines assuming roles, VMs using instance profiles or managed identities. Application user auth governs who logs into your product: Laravel Sanctum, AWS Cognito, or Entra ID B2C for customers booking services or uploading documents. On legal-tech portals where RBAC and external storage must align, keep these layers separate. Federation makes object storage integrations auditable; Sanctum or Cognito handles the lawyer or client signing into the portal.

Share this article

0 Comments

Leave a comment

Your email is not published. Comments appear once they have been read. Sign in to have your details filled in.

Quick Contact Options
Choose how you want to connect me: