Deployed Lab

Module 8 · Enterprise environment · Chapter 67 · Free

SSO, SCIM and RBAC

14 min1 clickable picture1 role design lab3 identity systems5-min video review
In 30 seconds

Picture: a hotel. The front desk checks your ID, the card system creates and cancels cards, and each card opens only your floors.

The problem Kavish pilots an AI assistant (a composite example) with 40 staff at a company of 4,200 people. The pilot uses its own sign up page, its own passwords, and a spreadsheet of who should have access. It works, so the customer asks the question that ends most pilots: "Can this pass our security review?" The review finds 3 people who left 47 days ago and can still sign in, 26 of the 40 pilot users holding admin rights they never use, and 1 shared login used by a whole support team, so nobody can say who asked what. The model was fine. The system had no identity story, and in an enterprise, identity is the story.
The plan for this chapter
  1. SSO in plain terms, and how SAML and OIDC differ.
  2. SCIM: the joiner, mover and leaver lifecycle, automated.
  3. One person's journey from hiring to leaving, as a picture.
  4. A lab: design roles for a real team and check them against least privilege.
  5. Service accounts for AI systems, and the questions to ask the identity team first.

After this chapter you can:

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:

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:

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.

The enterprise identity lifecycle HR creates a person in the identity provider. SCIM provisions an account in the AI app and maps groups to roles. The person signs in through SSO, RBAC checks the role on every action, and leaving triggers deprovisioning. HR and IdPsource of truth SCIMcreates the account SSO sign inSAML or OIDCwho are you RBAC checkrole decideswhat you may do The AI appwork happens here Deprovisionedaccess ends same day
  1. HR creates Maya in the company directory. The IdP is the only list that decides who works here.
  2. The IdP calls your SCIM endpoint with Maya's details and groups. Her account, and her starting role, exist before she ever visits.
  3. Maya clicks sign in, the IdP checks her, and a signed SAML or OIDC statement brings her back. Your app never sees her password.
  4. Being signed in is not being allowed. Her role, mapped from her groups, decides what she can search and change.
  5. Every prompt and export is tied to Maya's named account, so the audit trail can answer "who asked for this" months later.
  6. On her last day the IdP deactivates her, SCIM disables the account, and sessions and keys die with it. No 47 day gap.
DirectoryIdentity plumbingAccess removedYour app

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.

PersonSituationJob they must be able to do
1. MayaSupport agentSearch, see her own history, export a result for a ticket
2. TomSupport leadMaya's work, plus fix a wrong prompt and update an article
3. PriyaIT operationsConnect the IdP, assign roles, read the audit log
4. LeoFinance, curiousWants to "look around" the assistant. No support duties
5. AnaContractor, 3 monthsSearch documents for a migration project, nothing else
6. SamLeft the company last monthNothing. 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.

In the field An FDE team (composite) walked into a rollout for 900 staff with a working SSO demo and no SCIM. The identity team approved SSO in one meeting, then asked: "Show us a leaver losing access." A disabled test user kept working all afternoon, because accounts were created by hand and nothing removed them. Six weeks of rollout dates moved. The fix took nine days: a SCIM endpoint, group to role mapping, and a timed leaver test in every release. Demo the exit, not just the entrance.

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:

  1. Which IdP, and which protocol? Entra ID, Okta, Google, or something older? OIDC available, or SAML only?
  2. Is SCIM expected, and who owns provisioning? Some enterprises will not onboard an app without it.
  3. 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.
  4. What are the session and token rules? Timeouts, token lifetimes and step up checks are policy, not preference.
  5. How do leavers and break-glass work here? The deprovisioning SLA, the emergency process, and who reviews both.
  6. 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

Recap

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.

Review