Security & Identity
Identity and Access Management: Lifecycle, MFA and Authorization Models
Intermediate8 min readUpdated
Identity and access management is the discipline of knowing who every actor in a system is and what each may do, and keeping both accurate as people and services come and go. This guide covers the identity lifecycle, authentication factors including passkeys, correct password storage, the authorization models you will have to choose between, directories and provisioning, machine identities and access review.
What you will learn
- Describe the joiner-mover-leaver lifecycle and why deprovisioning is the hardest part
- Compare authentication factors and explain why passkeys resist phishing
- Store and verify passwords with a memory-hard algorithm and sensible policy
- Choose between ACL, RBAC, ABAC and ReBAC for a given authorization problem
- Use LDAP directories and SCIM provisioning in a federated environment
- Manage privileged accounts, machine identities and periodic access review
Every access-control decision a system makes rests on two facts: who is asking, and what that person or program is allowed to do. Identity and access management is the discipline of keeping both facts correct — not just at the moment an account is created, but through promotions, transfers, contractors, acquisitions, decommissioned services and the long tail of accounts nobody remembers granting. It is where security most often fails quietly, because a stale permission produces no error message.
For a developer, IAM shows up as concrete choices: which authentication factors to support, how to store credentials, which authorization model the domain actually needs, how to receive user accounts from a customer's directory, and what to do about the machine identities that outnumber the human ones. The protocols that carry identity between systems — OAuth 2.0 for delegated access and OpenID Connect for federated login — are covered separately; this guide is about the model underneath them.
The identity lifecycle
Accounts have a life, usually described as joiner, mover, leaver.
Joiner. An authoritative source — the HR system for employees, a contract register for suppliers, a registration flow for customers — creates the identity. Access is granted from a defined baseline for the role rather than by copying an existing colleague's permissions, a habit that spreads privilege like a rumour.
Mover. Someone changes team, is promoted or takes on a temporary duty. The dangerous pattern is privilege accumulation: the new access is granted, the old is never removed, and after several years a long-serving employee can do almost anything. Movement must trigger recertification of the whole entitlement set, not an addition to it.
Leaver. Departure must revoke access everywhere, promptly, including federated applications, VPNs, shared mailboxes, personal API tokens, cloud consoles and anything the person configured with their own credentials. This is where central identity pays for itself: disabling one directory account closes every application that federates against it, whereas locally managed accounts survive indefinitely.
Two supporting practices make the lifecycle real. Access review is a periodic exercise where the person accountable for a system confirms each user still needs their access; it works when the reviewer sees plain-language entitlements and can revoke in one click, and degrades to rubber-stamping when it presents raw group names. Segregation of duties encodes combinations that no single person may hold — creating a supplier and approving its payment, for example — and is checked at grant time rather than discovered during an audit.
Authentication factors
Authentication evidence falls into the traditional three categories: something you know, something you have, something you are. Their real-world strengths differ enormously.
| Factor | Resists phishing | Notes |
|---|---|---|
| Password | No | Necessary baseline; strength depends far more on length than on character classes |
| SMS one-time code | No | Vulnerable to SIM swap and interception; NIST discourages it |
| TOTP authenticator app | No | A six-digit code can be relayed in real time by a proxy phishing site |
| Push approval | Weak | Prompt bombing works; number matching helps but does not eliminate it |
| Passkey / WebAuthn security key | Yes | Origin-bound public-key credential; the strongest widely available option |
| Biometrics | Local only | Unlocks a key on the device; never transmitted as an authentication factor |
Passkeys, built on WebAuthn and FIDO2, are the modern answer. Registration creates a key pair on the authenticator; the private key never leaves it, and the public key is stored by the relying party. At login the browser signs a challenge together with the origin of the requesting site, so a credential for bank.example.com produces nothing a look-alike domain can use. That origin binding is what defeats real-time phishing proxies, which is why passkeys are displacing one-time codes rather than supplementing them. Synced passkeys follow the user across devices via a platform keychain; device-bound keys on a hardware token suit high-assurance roles.
Adaptive or risk-based authentication adjusts the requirement to the context — a new device, an unusual location, a large transfer triggers a step-up, while a familiar session does not. Combined with the acr and amr claims an identity provider issues, this lets an application demand a stronger factor for a specific operation instead of for every login.
Storing passwords correctly
Where passwords remain, the rules are narrow and non-negotiable. Never store them recoverably. Never use a plain fast hash: SHA-256 over a password is designed to be fast, which is precisely the property an attacker with a stolen table wants. Use a memory-hard, salted, tunable algorithm — Argon2id first choice, scrypt second, bcrypt where an ecosystem constraint requires it, PBKDF2 with a high iteration count where compliance demands a NIST-approved function.
// Argon2id with parameters tuned so verification costs a few hundred milliseconds on your hardware
Argon2PasswordEncoder encoder = new Argon2PasswordEncoder(
16, // salt length in bytes
32, // hash length in bytes
1, // parallelism
1 << 16, // 64 MiB memory cost
3); // iterations
String stored = encoder.encode(submittedPassword); // includes algorithm, parameters and salt
boolean ok = encoder.matches(submittedPassword, stored); // constant-time comparison, never equals()
The salt is per user and stored with the hash; it prevents one precomputed table from cracking every account at once. A pepper — a secret value held outside the database, in a key manager — adds protection when only the database leaks. Encode the algorithm and parameters in the stored string so you can raise the cost or migrate algorithms later, rehashing each password at the next successful login.
Policy matters as much as cryptography. Allow long passphrases and paste from a manager; screen candidate passwords against known-breached lists; drop composition rules that push people towards Summer2026!; rate-limit and lock out with an escalating delay rather than a fixed threshold that becomes a denial-of-service lever; and keep failure messages identical whether the account exists or not. A password generator that runs entirely in the browser is a reasonable thing to point users at when they need a strong value. Note that a general-purpose hash generator is for checksums and message digests — never for hashing a password, precisely because those algorithms are fast.
Authorization models
Choosing a model early is worth some thought, because retrofitting one is expensive.
Access control lists attach permitted subjects directly to each object. This is how filesystem permissions work, as described in Linux users, groups and permissions. Precise, but unmanageable at scale: nobody can answer "what can this user reach?" without scanning everything.
Role-based access control (RBAC) groups permissions into roles and assigns roles to users. It is the workhorse — comprehensible, auditable, supported everywhere. Its failure mode is role explosion: roles multiply to encode exceptions until there are more roles than users, at which point they have stopped being an abstraction.
Attribute-based access control (ABAC) evaluates a policy over attributes of the subject, the resource, the action and the environment. It expresses context that roles cannot, at the cost of policies that are harder to reason about and to test.
permit if
subject.department == resource.owningDepartment
and subject.clearance >= resource.classification
and action in {"read", "list"}
and environment.time within subject.workingHours
Relationship-based access control (ReBAC) models authorization as a graph — this user is an editor of that folder, which contains that document — and answers questions by traversing it. It suits collaboration products and hierarchical resources where permission flows through containment, and it is the model behind several modern policy services.
In practice, systems combine them: coarse roles or OAuth scopes at the perimeter and a fine-grained relationship or attribute check in the domain layer, where the ownership rule lives. Externalising policy to an engine — a sidecar or library evaluating declarative rules — keeps authorization out of business logic and makes it testable, but only pays off once several services share the same rules. Whatever the model, the decision point must be on the server, must be applied on every request, and must default to denial.
Directories, provisioning and federation
LDAP directories remain the authoritative user store in most large organisations. A directory is a hierarchical tree of entries identified by distinguished names, with users and groups as objects and attributes such as uid, mail and memberOf. Applications historically bound to LDAP directly to authenticate; today it is better to let the identity provider talk to the directory and give your application a federated login instead, so credentials never pass through your code.
SCIM (RFC 7644) solves the other half: getting accounts into an application and, more importantly, out of it. It is a REST protocol over a standard JSON user schema, and an identity provider uses it to create, update, deactivate and delete accounts as the directory changes.
PATCH /scim/v2/Users/2819c223-7f76-453a-919d-413861904646 HTTP/1.1
Host: app.example.com
Content-Type: application/scim+json
Authorization: Bearer <provisioning token>
{
"schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
"Operations": [
{ "op": "replace", "path": "active", "value": false }
]
}
Supporting SCIM turns deprovisioning from a manual ticket into an automatic consequence of a directory change, which is the single most valuable thing a business application can do for its customers' security posture. Setting active to false should immediately end sessions and revoke tokens, not merely hide the account from a list.
Privileged, machine and cloud identities
Administrator accounts deserve separate treatment. Privileged access management means: no standing administrative rights, elevation requested for a task and granted for a bounded time, separate accounts for administrative work, session recording where the risk warrants it, and hardware-backed authentication for every privileged login. Break-glass credentials exist, sealed, monitored and tested — and their use raises an alert automatically.
Machine identities now outnumber human ones. Services, jobs, pipelines and containers all need to authenticate, and the wrong answer is a shared API key in a configuration file. Prefer identity the platform issues to the running workload: an instance role in a cloud account, a projected service account token in Kubernetes, a short-lived certificate from an internal authority for mutual TLS. In AWS core services terms, this is the difference between an access key checked into a repository and a role assumed by a running instance with no static credential anywhere. Where a static secret is unavoidable, scope it to one action, rotate it automatically and alert on use from an unexpected source.
Finally, audit. Every authentication, authorization decision on a sensitive resource, permission grant and privilege elevation should produce a log entry with the actor, the action, the target, the outcome and the time, written somewhere the actor cannot edit. That record is what turns an incident from speculation into a timeline.
Key takeaways
- Identity is a lifecycle, not a registration form; movers accumulate privilege and leavers must lose access everywhere, promptly.
- Passkeys built on WebAuthn are origin-bound and phishing-resistant, which is why they now outrank one-time codes and push approvals.
- Store passwords with Argon2id or an equivalent memory-hard function, salted and parameterised, and prefer length screening over composition rules and forced rotation.
- Pick the authorization model the domain needs — roles for coarse permissions, attributes or relationships when context and ownership decide — and enforce it server-side, every time.
- Federate authentication to the directory and support SCIM so that account creation and, above all, deactivation are automatic.
- Give privileged and machine identities the same rigour as human ones: no standing rights, no static secrets where the platform can issue short-lived ones, and an audit trail nobody can rewrite.
Sources and further reading
Frequently asked questions
- Are passkeys really better than an authenticator app?
- Yes, in the way that matters most. A time-based one-time code can be read out by a victim on a convincing fake login page and replayed by the attacker within seconds. A passkey signs a challenge that includes the origin of the site requesting it, so a credential registered for your domain simply will not produce a usable signature for a look-alike domain. That removes real-time phishing as an attack path.
- Should passwords expire every 90 days?
- Current NIST guidance says no. Forced rotation pushes people towards predictable variations and writing passwords down, which lowers security overall. Rotate on evidence of compromise instead, screen new passwords against lists of known breached values, allow long passphrases and paste from managers, and put the remaining effort into a phishing-resistant second factor.
- When is RBAC not enough?
- When permission depends on the relationship between the user and the specific object, or on context such as time, location or data classification. Roles answer what kind of person you are; they cannot express that a manager may approve expenses only for their own reports and only below a threshold. At that point you either add attribute-based rules or model relationships explicitly and query them.
- How should service-to-service credentials be handled?
- Prefer identity issued by the platform to the running workload — a cloud instance role, a Kubernetes service account token, a mutual-TLS certificate from an internal authority — so that no long-lived secret exists to steal. Where a static credential is unavoidable, keep it in a secret manager, scope it narrowly, rotate it automatically and monitor for use from unexpected sources.