Module 8 · Enterprise environment · Chapter 67 · Free
SSO, SCIM and RBAC
- SSO answers "who is this person", SCIM answers "should this account exist", RBAC answers "what may they do".
- Your app never stores enterprise passwords. The customer's identity provider does the signing in.
- The dangerous failures are quiet ones: leavers who keep access, and helpers who were given admin.
Picture: a hotel. The front desk checks your ID, the card system creates and cancels cards, and each card opens only your floors.
- SSO in plain terms, and how SAML and OIDC differ.
- SCIM: the joiner, mover and leaver lifecycle, automated.
- One person's journey from hiring to leaving, as a picture.
- A lab: design roles for a real team and check them against least privilege.
- Service accounts for AI systems, and the questions to ask the identity team first.
After this chapter you can:
- Explain SSO, SCIM and RBAC in one sentence each, without jargon.
- Tell SAML and OIDC apart, and say which one a new build usually picks.
- Design a small role set where permissions attach to roles, never to people.
Next: the words you will see.
Words you'll meet
- SSO
- Single sign on: sign in once with your work account, then open many apps without another password. Example: you log in in the morning and the AI assistant just opens.
- SAML
- Security Assertion Markup Language: an older, XML based way for an identity provider to vouch for a user to an app. Example: many large enterprises run SSO on SAML.
- OIDC
- OpenID Connect: a newer sign in layer built on OAuth 2.0, using JSON tokens. Example: most new apps ask for OIDC first. Chapter 63 covers OAuth in depth.
- SCIM
- System for Cross-domain Identity Management: a standard way for the identity provider to create, update and remove accounts in your app automatically. Example: HR marks a leaver, and SCIM disables their account the same day.
- RBAC
- Role based access control: permissions are grouped into roles, and people get roles. Example: Analysts run searches, Admins change settings, and nobody edits permissions person by person.
- IdP
- Identity provider: the system that holds the company's accounts and proves who a user is. Example: Microsoft Entra ID, Okta or Google Workspace.
- Service account
- A non human account an application or agent uses to call other systems. Example: the account your retrieval service uses to read the document store at 2 a.m.
- Least privilege
- Give every person and service exactly the access its job needs, and no more. Example: a read only role for a reporting job, not an admin key.
- Provisioning
- Creating an account and its starting access when someone should have it. Example: a joiner's account appears on their first morning, before they ask.
- Deprovisioning
- Removing access when someone leaves or changes role. Example: a leaver's account is disabled within hours of their last day.
- Break-glass account
- A tightly guarded emergency account for when SSO itself is broken. Example: one named admin account, vaulted and alarmed on use.
Next: the front door, where SSO decides who gets in.
Step 1: SSO, or one front door for every app
Start with the pain SSO removes. Without it, every app keeps its own list of users and passwords. People reuse weak passwords, and keep them after they leave. IT cannot turn off access in one place, because there is no one place.
With SSO, the app gives up the password job entirely. When a user arrives, the app sends them to the company's identity provider, the IdP. The IdP checks who they are, usually with the strong checks the company already runs, like a hardware key or an authenticator app. Then the IdP sends the app a signed statement: "this is Maya Chen, here are her email and groups, and we checked her just now." The app trusts it because it can verify the signature.
Two protocols carry that statement, and you will meet both:
- SAML is the veteran. It passes signed XML documents between the IdP and the app, mostly in browser redirects. It is everywhere in large enterprises, and verbose and fiddly to debug. If the IdP team says "we do SAML", you do SAML, and budget time for metadata and certificates.
- OIDC is the modern default. It sits on top of OAuth 2.0 (Chapter 63), passes JSON tokens, and works cleanly for web, mobile and APIs. A token carries claims, small facts about the user, such as ID, email and groups. New builds ask for OIDC first, falling back to SAML when the estate demands it.
The rule of this chapter: if an enterprise demo still has its own password page in week three, it is not nearly done. Identity is not a feature you add at the end, and the security review (Chapter 66) will ask about it before it asks about the model.
Next: SCIM, the system that creates accounts before people ask and removes them before they become a risk.
Step 2: SCIM and the joiner, mover, leaver lifecycle
SSO solves signing in. It does not solve the account list. If Maya can sign in through the IdP but has no account in your app, someone still has to create one, and when she leaves, someone has to remember to remove it. In the problem story, nobody remembered, for 47 days, three times. That remembering job is what SCIM automates.
SCIM is a standard API your app exposes. The IdP calls it whenever the directory changes:
- Joiner: HR creates Maya's company account. The IdP sends a SCIM create call with her name, email and groups. Her account exists before her first sign in.
- Mover: Maya moves from support to sales. The IdP sends an update, your app remaps her roles, and she loses support access and gains sales access in one motion.
- Leaver: Maya leaves. The IdP sends a deactivate call. Your app disables her account, kills her sessions and keys, and keeps her past work attributed to her name. Access ends the same day.
A SCIM create call looks like this. It is plain JSON over HTTPS, which is the point: any IdP can speak it, with no custom integration per customer.
POST /scim/v2/Users
Authorization: Bearer <token held by the IdP only>
{
"schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
"userName": "maya.chen@example.com",
"emails": [{ "value": "maya.chen@example.com", "primary": true }],
"active": true,
"groups": [{ "value": "support-leads", "display": "Support Leads" }]
}
Leaver update, sent the day Maya leaves:
PATCH /scim/v2/Users/8f42... { "active": false }
Two habits make SCIM trustworthy. First, treat the IdP as the source of truth for who exists: a hand created account is a finding waiting to happen. Second, test the leaver path early. Deactivate a test user at the IdP and time how long your app keeps letting them in. Auditors test the leaver path because it is where the risk lives. Guardrails and AI security (Chapter 19) makes the same point from the model side.
Next: one person through the whole lifecycle, in a picture.
Step 3: One person, hire to exit
Put the three together and a person's access becomes a journey with no manual steps. Press next to walk Maya through it.
On a phone, swipe the picture sideways.
- HR creates Maya in the company directory. The IdP is the only list that decides who works here.
- The IdP calls your SCIM endpoint with Maya's details and groups. Her account, and her starting role, exist before she ever visits.
- Maya clicks sign in, the IdP checks her, and a signed SAML or OIDC statement brings her back. Your app never sees her password.
- Being signed in is not being allowed. Her role, mapped from her groups, decides what she can search and change.
- Every prompt and export is tied to Maya's named account, so the audit trail can answer "who asked for this" months later.
- On her last day the IdP deactivates her, SCIM disables the account, and sessions and keys die with it. No 47 day gap.
Where the picture breaks down: the flow is only as fast as its slowest link. If HR takes a week to mark a leaver, SCIM provisions a week of extra access. Ask about timing, not just existence. One account sits outside the flow on purpose: the break-glass account, for the day SSO itself is down.
Next: the lab, where you design the roles yourself.
Step 4: Lab: design roles that survive least privilege
Why: RBAC fails in a predictable way. Permissions get attached to people one request at a time, until nobody can say who can do what. Designing roles on paper first, from the jobs people do, is the whole skill.
The rule is two layers, never one. Permissions are single abilities: search documents, export results, edit prompts, manage users. Roles are bundles of permissions named after jobs. People get roles. Roles get permissions. Nobody edits a person directly. As config, the support assistant needs only this:
roles:
viewer:
- search:documents
- view:own-history
analyst:
- search:documents
- view:own-history
- export:results
- view:team-reports
editor:
- search:documents
- view:own-history
- edit:prompts
- edit:knowledge-base
admin:
- manage:users
- manage:roles
- manage:integrations
- view:audit-log
group to role mapping (from the IdP):
support-team -> analyst
support-leads -> editor
it-operations -> admin
Now the worked example. Six people, one decision each. Choose the smallest role that lets each person do the job described, or "no role" where access should not exist at all.
| Person | Situation | Job they must be able to do |
|---|---|---|
| 1. Maya | Support agent | Search, see her own history, export a result for a ticket |
| 2. Tom | Support lead | Maya's work, plus fix a wrong prompt and update an article |
| 3. Priya | IT operations | Connect the IdP, assign roles, read the audit log |
| 4. Leo | Finance, curious | Wants to "look around" the assistant. No support duties |
| 5. Ana | Contractor, 3 months | Search documents for a migration project, nothing else |
| 6. Sam | Left the company last month | Nothing. Appears in the pilot spreadsheet as an admin |
Lab: Kavish's pilot had 26 of 40 users holding admin rights they never used. This lab runs in your browser and needs JavaScript enabled.
Next: the accounts nobody signs into, and the questions that save you a rebuild.
Step 5: Service accounts, and asking the identity team first
Humans sign in. Systems also act, and AI systems act a lot: the nightly reindexing job, the agent that reads a mailbox, the retrieval service querying the warehouse at 2 a.m. Each needs an identity too, a service account, and service accounts are where least privilege goes to die, because "just give it admin, it is only a script" is said everywhere.
Treat a service account like a person with a very narrow job. Its own credentials, never a borrowed human login, and the smallest scope that works: read only on the one store it syncs. Its keys rotate and live in a secrets vault, not in code. Its actions are logged under its own name, and a named human owns it. An agent that can call tools (Chapter 19 covers the guardrail side) is only as safe as the service account behind it.
Finally, the part that saves projects: ask the identity team before you build, not during the security review. The questions that matter:
- Which IdP, and which protocol? Entra ID, Okta, Google, or something older? OIDC available, or SAML only?
- Is SCIM expected, and who owns provisioning? Some enterprises will not onboard an app without it.
- Which groups exist, and can we get new ones? Mapping only works if directory groups match real teams, and a new group can take weeks.
- What are the session and token rules? Timeouts, token lifetimes and step up checks are policy, not preference.
- How do leavers and break-glass work here? The deprovisioning SLA, the emergency process, and who reviews both.
- What evidence will the review want? Log format, retention, and where logs must land. Chapter 66 lists the review itself.
Ask these in the first fortnight and identity stays plumbing. Skip them, and it becomes the surprise agenda item at shipping time, the difference between a pilot and production (Chapter 72).
Next: a prediction, two quick checks, then the final quiz.
Identity is usually the first gate, not the last. Leavers with live accounts are findings a good demo cannot outrun.
Quick checks
Mix-ups to avoid
- "SSO is done, so identity is done." SSO covers sign in only. Without SCIM, accounts still appear and disappear by hand, and leavers linger.
- "Roles and permissions are the same thing." Permissions are single abilities. Roles bundle them. People get roles, and that indirection is what keeps access reviewable.
- "Give them admin for now, tighten later." Later rarely comes, and the review counts your admins. Start narrow.
Recap
- SSO proves who someone is (SAML or OIDC), SCIM manages whether their account exists, RBAC decides what they may do.
- The leaver path is the test that matters: deprovisioning must be automatic and proven.
- Service accounts are identities too: narrow scope, vaulted keys, a named owner.
- Ask the identity team six questions in the first fortnight, before identity becomes the blocker.
Next: Chapter 68, "Data governance: ownership, retention and the audit trail": who owns the data your system touches, how long it may keep it, and how you prove both.
Review this chapter in 5 minutes
The three identity systems, the lifecycle, the role lab, and the six questions.
Chapter quiz
Four questions. Score 70% or more to mark this chapter complete.