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 type | Who | Typical requirements | Typical solution |
|---|---|---|---|
| Workforce | Employees, contractors, partners | Single sign-on (SSO) to all internal tools, MFA, automatic onboarding and offboarding from the HR system, access reviews | Workforce identity provider (IdP) |
| Customer (CIAM) | End users of your products | Self-registration, social login, passkeys, consent and privacy (GDPR), branding, scale to millions of users | Customer identity platform |
| Workload / machine | Services, jobs, CI/CD pipelines, AI agents | No passwords or long-lived keys, short-lived credentials, automatic rotation | Cloud IAM roles, workload identity, secrets management |
| Privileged | Administrators, on-call engineers in production | Just-in-time access, approval, session recording, break-glass procedures | Privileged Access Management (PAM) |
Key concepts
| Concept | Meaning |
|---|---|
| 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 |
| Federation | Trusting 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 |
| Provisioning | Creating, updating and removing accounts in applications automatically, usually from the HR system through the IdP, using SCIM |
| Joiner–mover–leaver | The identity lifecycle: access granted when someone joins, adjusted when they change roles, removed immediately when they leave |
| Least privilege | Every identity gets only the permissions it needs, for only as long as it needs them |
| Zero trust | No 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.
| Standard | Purpose |
|---|---|
| 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.0 | Older 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.0 | Standard API for provisioning users and groups into applications |
| WebAuthn / FIDO2 | Passwordless, 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.
- The user opens the application.
- The application redirects to the identity provider using OpenID Connect.
- 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).
- The application calls APIs with the access token.
- 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?"
- 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"
}
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.
| Model | How it works | Good for | Watch out for |
|---|---|---|---|
| RBAC (role-based) | Permissions are assigned to roles, and users get roles | Simple, 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 day | Context-dependent rules, regulatory requirements | Rules 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 Zanzibar | Sharing and collaboration, hierarchies, multi-tenant SaaS | Needs 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.
| Tool | Approach |
|---|---|
| Open Policy Agent (OPA) | General-purpose policy engine with the Rego language. Also used for Kubernetes and infrastructure policies |
| Cedar | Readable, analyzable policy language created by AWS. Available as a managed service in Amazon Verified Permissions |
| OpenFGA | Relationship-based (Zanzibar-style) authorization, a CNCF project |
| SpiceDB | Relationship-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
| Platform | Notes |
|---|---|
| Microsoft Entra ID (formerly Azure AD) | The default in Microsoft 365 organizations. Deep integration with Windows, Office and Azure |
| Okta Workforce Identity | Independent IdP with a very large catalog of pre-built application integrations |
| Google Cloud Identity | Identity for Google Workspace organizations and Google Cloud |
| Ping Identity | Enterprise IdP, strong in hybrid and regulated environments |
| JumpCloud | Directory, SSO and device management for small and medium organizations |
Customer identity (CIAM)
| Platform | Notes |
|---|---|
| Auth0 (by Okta) | Developer-friendly CIAM with many SDKs and extensibility |
| Microsoft Entra External ID | Microsoft's CIAM, successor of Azure AD B2C |
| Amazon Cognito | AWS-native user pools and identity federation, priced per active user |
| Firebase Authentication / Google Identity Platform | Simple sign-in for web and mobile apps on Google Cloud |
| FusionAuth | CIAM that can be self-hosted or used as a service |
Open source identity providers
| Platform | Notes |
|---|---|
| Keycloak | The most widely used open source IdP, a CNCF project. Supports OIDC, SAML, federation and user federation with LDAP / Active Directory |
| ZITADEL | Cloud-native IdP with multi-tenancy built in |
| Ory | Set 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
- NIST SP 800-63-4, Digital Identity Guidelines: authentication strength and identity proofing
- NIST SP 800-207, Zero Trust Architecture
- RFC 9700, OAuth 2.0 Security Best Current Practice
- How OpenID Connect Works (OpenID Foundation)
- OWASP Authorization Cheat Sheet