Skip to main content

Identity and Access Management

Identity and Access Management (IAM) answers two questions for every request in every system:

  • Authentication (AuthN): Who are you? A person, a customer, a service, a pipeline.
  • Authorization (AuthZ): What are you allowed to do? Read this order, approve this payment, deploy to production.

Every application needs both, and getting either wrong leads to the most serious security incidents. That is why IAM should be a platform capability: built and operated once, centrally, by specialists, and consumed by every application through standard protocols. Product teams should never write their own login page, password storage or token validation.

Kinds of identities​

IAM covers more than employees logging in. A platform typically serves four kinds of identities, each with different requirements:

Identity typeWhoTypical requirementsTypical solution
WorkforceEmployees, contractors, partnersSingle sign-on (SSO) to all internal tools, MFA, automatic onboarding and offboarding from the HR system, access reviewsWorkforce identity provider (IdP)
Customer (CIAM)End users of your productsSelf-registration, social login, passkeys, consent and privacy (GDPR), branding, scale to millions of usersCustomer identity platform
Workload / machineServices, jobs, CI/CD pipelines, AI agentsNo passwords or long-lived keys, short-lived credentials, automatic rotationCloud IAM roles, workload identity, secrets management
PrivilegedAdministrators, on-call engineers in productionJust-in-time access, approval, session recording, break-glass proceduresPrivileged Access Management (PAM)

Key concepts​

ConceptMeaning
Identity provider (IdP)The system that authenticates users and issues tokens or assertions that applications trust
Single sign-on (SSO)Log in once at the IdP and access many applications without logging in again
FederationTrusting identities from another IdP, for example letting a partner's employees use their own company login
Multi-factor authentication (MFA)Proving identity with more than one factor. Phishing-resistant methods such as passkeys (FIDO2/WebAuthn) are now the recommended standard
ProvisioningCreating, updating and removing accounts in applications automatically, usually from the HR system through the IdP, using SCIM
Joiner–mover–leaverThe identity lifecycle: access granted when someone joins, adjusted when they change roles, removed immediately when they leave
Least privilegeEvery identity gets only the permissions it needs, for only as long as it needs them
Zero trustNo implicit trust based on network location. Every request is authenticated and authorized, see NIST SP 800-207

Standards​

IAM is one area where standards matter more than products. Applications built on standard protocols can switch identity providers without code changes.

StandardPurpose
OAuth 2.0 (RFC 6749)Delegated authorization: lets an application obtain an access token to call APIs on behalf of a user or itself. Current security guidance is in RFC 9700
OpenID Connect (OIDC)Authentication on top of OAuth 2.0: adds an ID token that tells the application who the user is. The default choice for new applications (OIDC Core spec)
SAML 2.0Older XML-based SSO standard, still widely used by enterprise and SaaS applications
JWT (RFC 7519)The common format for ID and access tokens: signed JSON that services can validate without calling the IdP
PKCE (RFC 7636)Protects the OAuth authorization code flow against interception. Recommended for all clients, including server-side web apps
SCIM 2.0Standard API for provisioning users and groups into applications
WebAuthn / FIDO2Passwordless, phishing-resistant authentication with passkeys and security keys

Reference architecture​

The diagram shows how the pieces fit together for a typical web application with APIs.

  1. The user opens the application.
  2. The application redirects to the identity provider using OpenID Connect.
  3. The user authenticates (SSO, MFA, passkey). The IdP returns an ID token (who the user is) and an access token (what the app may call).
  4. The application calls APIs with the access token.
  5. The API gateway validates the token's signature, issuer, audience and expiry, and rejects invalid requests before they reach any service. This is coarse-grained authorization: "may this client call this API at all?"
  6. The service makes the fine-grained decision ("may this user approve this order?"), ideally by asking a central policy engine instead of hard-coding rules.

Identities and group memberships flow from the HR system into the IdP, so that access follows the joiner–mover–leaver lifecycle automatically.

Login flow in detail​

The recommended flow for web and mobile applications is the authorization code flow with PKCE:

An access token in JWT format carries claims that APIs use for authorization:

{
"iss": "https://login.example.com",
"sub": "user-8f3a21",
"aud": "orders-api",
"exp": 1767225600,
"scope": "orders:read orders:approve",
"groups": ["sales-managers"],
"department": "emea-sales"
}
warning

Keep tokens small and short-lived (minutes, not days). Do not put large lists of permissions into tokens: they become stale and bloated. Put identity and a few stable attributes in the token, and let the service or policy engine make detailed decisions.

Authorization models​

Authentication is largely solved by standards and products. Authorization is where most of the design work remains, because it depends on the business domain.

ModelHow it worksGood forWatch out for
RBAC (role-based)Permissions are assigned to roles, and users get rolesSimple, stable permission sets; easy to audit"Role explosion" when roles are created for every special case
ABAC (attribute-based)Rules evaluate attributes of the user, resource and context, for example department, amount, time of dayContext-dependent rules, regulatory requirementsRules can become hard to understand and test
ReBAC (relationship-based)Access follows relationships, for example "members of a team can edit documents in the team's folders". Inspired by Google's ZanzibarSharing and collaboration, hierarchies, multi-tenant SaaSNeeds a dedicated service to store and query relationships

In practice, most organizations combine them: roles for broad access, attributes and relationships for the fine-grained rules.

Authorization as a platform service​

Instead of every service hard-coding if user.role == "admin", a platform can offer policy as code: rules written in a dedicated language, versioned, tested and reviewed, and evaluated by a central or embedded policy engine.

ToolApproach
Open Policy Agent (OPA)General-purpose policy engine with the Rego language. Also used for Kubernetes and infrastructure policies
CedarReadable, analyzable policy language created by AWS. Available as a managed service in Amazon Verified Permissions
OpenFGARelationship-based (Zanzibar-style) authorization, a CNCF project
SpiceDBRelationship-based authorization database, also inspired by Zanzibar

Example of a Cedar policy: order managers may approve orders from their own department below a certain amount.

permit (
principal in Role::"order-manager",
action == Action::"approveOrder",
resource
)
when {
principal.department == resource.department &&
resource.amount < 10000
};

The OWASP Authorization Cheat Sheet gives practical guidance for implementing authorization securely. Broken access control is the top risk in the OWASP Top 10.

Workload identity and secrets​

Services, jobs and pipelines need identities too. The classic approach, a long-lived API key or password in a configuration file, is one of the most common causes of breaches. The platform should make the secure way the easy way:

  • Use the platform's identity instead of secrets. Cloud workloads get identities from the platform: IAM roles for AWS services, managed identities in Azure, service accounts in Google Cloud and Kubernetes. Credentials are issued automatically and expire quickly.
  • Federate CI/CD with OIDC. Pipelines exchange a short-lived token from the CI system for cloud credentials, with no stored keys. The provisioning page shows this for GitHub Actions and AWS.
  • Service-to-service authentication. Use mutual TLS (often provided by a service mesh such as Istio) or OAuth client credentials. SPIFFE defines a standard for workload identities across platforms.
  • Central secrets management. Where secrets cannot be avoided (third-party API keys, database passwords), store them in a secrets manager such as HashiCorp Vault or AWS Secrets Manager, with access control, auditing and automatic rotation. Never in code or repositories.

Platforms​

Workforce identity​

PlatformNotes
Microsoft Entra ID (formerly Azure AD)The default in Microsoft 365 organizations. Deep integration with Windows, Office and Azure
Okta Workforce IdentityIndependent IdP with a very large catalog of pre-built application integrations
Google Cloud IdentityIdentity for Google Workspace organizations and Google Cloud
Ping IdentityEnterprise IdP, strong in hybrid and regulated environments
JumpCloudDirectory, SSO and device management for small and medium organizations

Customer identity (CIAM)​

PlatformNotes
Auth0 (by Okta)Developer-friendly CIAM with many SDKs and extensibility
Microsoft Entra External IDMicrosoft's CIAM, successor of Azure AD B2C
Amazon CognitoAWS-native user pools and identity federation, priced per active user
Firebase Authentication / Google Identity PlatformSimple sign-in for web and mobile apps on Google Cloud
FusionAuthCIAM that can be self-hosted or used as a service

Open source identity providers​

PlatformNotes
KeycloakThe most widely used open source IdP, a CNCF project. Supports OIDC, SAML, federation and user federation with LDAP / Active Directory
ZITADELCloud-native IdP with multi-tenancy built in
OrySet of API-first identity components (identity, OAuth2 / OIDC server, permissions)

Cloud IAM​

Each cloud has its own IAM for access to cloud resources, typically connected to the workforce IdP through SSO: AWS IAM and IAM Identity Center, Azure RBAC, and Google Cloud IAM.

Identity governance​

Larger organizations add Identity Governance and Administration (IGA), for example SailPoint, for access requests, approval workflows, periodic access reviews, and segregation-of-duties checks required by auditors.

IAM as a platform capability​

Following the platform mindset, the platform team should make secure identity the default for every application:

  • One IdP per identity type. One workforce IdP and one customer identity platform, not one per team or per application.
  • Identity in the golden path. Templates (provisioning) include a pre-configured OIDC client, token validation middleware, and the API gateway configuration. Teams register the application, they do not build authentication.
  • Groups, not individuals. Access is granted to groups that are managed in the IdP and fed from the HR system. Ownership of applications and permissions is recorded in the systems inventory.
  • No long-lived credentials. Workload identity and OIDC federation by default. Secrets management for the rest, with rotation.
  • Central policy where it pays off. Offer a policy engine for fine-grained authorization, so teams write policies instead of custom permission code.
  • Audit everything. Login events, token issuance, permission changes and authorization decisions go to the central observability platform and the security team's SIEM.
  • Regular access reviews. Owners confirm periodically who has access to their systems. Unused access is removed automatically.

Further reading​