Connecting a directory to cloud sign-in
Cedar Inc. is moving its expense reporting to a cloud application, and Riley's account lives in Cedar's Active Directory. This lesson keeps apart the two connections that make that work, provisioning and sign-in, compares three places Riley's password can be checked, and plans for leavers, outages and a careful migration.
Two connections to reason about
Cedar Inc. is moving its expense reporting to a cloud application. Riley and the rest of the finance team will use it first. The application relies on a cloud directory, and Cedar's people already have accounts in Cedar's Active Directory. Getting Riley from one to the other takes two separate connections, and most of the trouble in hybrid setups comes from treating them as one.
The first connection is provisioning, often called synchronization. It moves selected account data from Cedar's directory into the cloud directory: who exists, their names and email addresses, which groups they are in, and whether their account is active. The second is authentication: when Riley signs in to the expense application, some party has to check Riley's password or other credential. Provisioning an account answers neither "how does Riley sign in?" nor "what may Riley do in the expense application?".
Provisioning starts with deciding which system is the source for each field and how accounts on the two sides are matched. Cedar uses each directory account's permanent identifier as the anchor, so the match survives a change of name or email address. Here is the cloud directory receiving Riley's account over SCIMThe System for Cross-domain Identity Management: a standard shape for users and groups and a standard set of HTTP requests for creating, changing, and disabling accounts in applications., the provisioning protocolAn agreed set of rules for the messages two systems exchange and what each message means. HTTP, OAuth 2.0, OpenID Connect and SAML are all protocols. introduced in SCIM requests and responses:
POST /scim/v2/Users HTTP/1.1
Host: directory.cloudsuite.example
Authorization: Bearer demo-provisioning-token-3
Content-Type: application/scim+json
{
"schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
"externalId": "0f6c2b8e-41d3-4a7e-9b52-7d1e3c9a0f64",
"userName": "[email protected]",
"displayName": "Riley",
"emails": [{ "value": "[email protected]", "primary": true }],
"active": true
}The externalId is the anchor taken from Cedar's directory. The request creates an account and nothing else. It does not give Riley a way to sign in, and it does not give Riley any permission in the expense application. All names, hosts, identifiers and tokens in these examples are fictional.
Where is the password checked?
Riley's password lives in Cedar's Active Directory. When Riley signs in to the cloud application, there are three common ways to decide whether it is right, and each puts the check in a different place.
With password hash synchronization, the provisioning connection also sends a further-hashed form of each directory password hash to the cloud directory, which then checks Riley's password itself. The cloud directory never receives the password, and what it stores is not the NT hash Active Directory uses, so it cannot be used for pass-the-hash against Cedar's own servers. With pass-through authentication, the cloud directory takes the password Riley typed and passes it, encrypted, to an agent running inside Cedar's network, which checks it against a domain controller and returns the answer. With federation, the cloud directory never sees the password at all. It sends Riley to Cedar's own sign-in service, login.cedar.example, which checks the password and returns a signed statement that the cloud directory verifies.
| Question | Password hash synchronization | Pass-through authentication | Federation |
|---|---|---|---|
| Where the password is checked | In the cloud directory | At Cedar's domain controller, by an on-premises agent | At login.cedar.example |
| What the cloud directory holds | A derived hash of each password | No password data | No password data, and the certificate it trusts for Cedar's signatures |
| If Cedar's network is down | Sign-in still works | Sign-in fails unless a fallback is set up | Sign-in fails unless a fallback is set up |
| After Riley changes the password | The old password works in the cloud until the next sync, usually minutes | The new password works at once | The new password works at once |
| Parts to protect | The sync connection and its account, which can read password data | The agents and their servers | The sign-in service and its signing key |
Federation has one more step worth following. When login.cedar.example vouches for Riley, the cloud directory has to decide which account that statement is about. It matches the trusted issuerThe party that creates and signs a token, assertion, or certificate, named in a token's iss claim. A recipient must check that the issuer is exactly the one it expected and trusts. and the subject identifier in the statement, which Cedar sets from the same directory anchor used in provisioning. It does not match on email address, because an email in a sign-in statement is a claim about the person, and matching on it is how accounts get taken over, as Abusing federation and account linking shows. When an existing cloud account has to be connected to a new sign-in source for the first time, the person proves they control that account before the link is made.
Cedar chooses federation, with provisioning over SCIM. A clean provisioning run proves none of the sign-in path: not the federation certificateA signed statement that a public key belongs to a name, such as a website's hostname, for stated purposes and a limited period. A certificate authority signs it, so software that trusts the authority can connect the key to the name., not login.cedar.example, and not the link between Riley's sign-in and Riley's account. Each needs its own test.
Changes and outages need explicit behavior
Because there are two connections, events at Cedar reach the cloud by different routes. When an accountant leaves on a Friday, Cedar disables the directory account at 17:02. Federation refuses new sign-ins immediately, because login.cedar.example checks the directory. The provisioning connection sends the change to the cloud directory a few minutes later:
PATCH /scim/v2/Users/7c41e0a2-93b5-4d8f-a1c6-58e2f9b03d17 HTTP/1.1
Host: directory.cloudsuite.example
Authorization: Bearer demo-provisioning-token-3
Content-Type: application/scim+json
If-Match: W/"4"
{
"schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
"Operations": [{ "op": "replace", "path": "active", "value": false }]
}Both routes matter. Suppose some sign-in path still accepted the accountant's password, because a fallback method had been switched on or a misconfigured sign-in service had not seen the change. The cloud directory would still refuse, because the account itself is disabled. A sign-in that succeeds at the identity providerA service that authenticates users and tells other applications about the sign-in, so those applications never handle the users' passwords. In OpenID Connect it is called an OpenID Provider. does not override the account's own state. Sessions the person already had in the expense application are a third matter: they last until they expire or are ended, as Revoking access and sharing security events explains. If the accountant returns as a contractor, a narrow update setting active back to true restores the same account and its history instead of creating a second one.
Outages need the same explicit thinking. If login.cedar.example goes down on Monday morning, nobody at Cedar can sign in to the cloud application. Some organizations keep password hash synchronization running as a fallback they can switch to, but that is a decision with its own consequences: it changes where passwords are checked and what the cloud directory stores. It works only if it was configured and tested before the outage. Nothing switches over by itself.
The parts that make these connections work are powerful in their own right. The provisioning connection can create and disable every account, and a synchronization account that reads password data can read it for everyone. The federation signing key lets its holder vouch for any Cedar user. These deserve the protection given to administrator credentials, with every change to them recorded. Cedar also keeps an emergency administrator account that exists only in the cloud directory and depends on neither connection, so a broken certificate or a failed agent cannot lock everyone out, as Protecting privileged access describes.
Migrate with a healthy control
Cedar starts with the twelve people in finance rather than the whole company. For each test account the team checks four things separately: the account arrived with the right anchor and fields, Riley's sign-in went through login.cedar.example and landed in Riley's own account, the expense application gave Riley the access the finance role allows and no more, and a disabled test account was refused. The team also watches one account it deliberately left alone, a colleague outside the pilot who signs in the old way. If that colleague's sign-in breaks, the change reached further than intended.
A provisioning run can also be interrupted halfway. A request that timed out may or may not have created an account, so the provisioning service looks the person up by anchor before trying again, instead of creating a duplicate, as Keeping systems in sync describes. A sign-in page that says "Welcome, Riley" means something only when it belongs to the right person, reached through the intended sign-in path, in the account matched by the intended anchor, with access that comes from a current grant.
Check your understanding
Try these questions before moving on. If an answer isn't right, use the feedback and try again.
Try it in the Lab
- Verify account movement separately from sign-inProvision an account over SCIM, connect it to a sign-in from another tenant, disable and restore it as the directory would, and compare where the password is checked.