> ## Documentation Index
> Fetch the complete documentation index at: https://developers.scoutworks.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Microsoft Entra ID

> Provision volunteers from Microsoft Entra ID over SCIM, and let them sign in with their Microsoft work account.

This guide sets up both halves for a Microsoft 365 organisation: **provisioning** (Entra pushes people and groups to Scoutworks over SCIM) and **sign-in** (volunteers use their Microsoft work account). You can do either on its own.

You need an Entra role that can create and configure enterprise applications (Application Administrator or Cloud Application Administrator), and admin access to your group or district in Scoutworks.

> [!NOTE]
>
> Until Scoutworks is listed in the Microsoft Entra app gallery, you create it as your own ("non-gallery") enterprise application. The values are the same either way.

## 1. Verify your domain in Scoutworks

In Scoutworks, open **Settings → Sign-in and directory**, choose **Microsoft Entra ID**, and add your email domain. Publish the TXT record it shows, then press **Check now**. A domain you verified before is skipped. See [Verified domains](https://developers.scoutworks.app/scim-sso/safety.md#verified-domains).

## 2. Set up provisioning (SCIM)

**1. Create the enterprise application**

In the Microsoft Entra admin centre, go to **Enterprise applications → New application → Create your own application**. Name it "Scoutworks", choose **Integrate any other application you don't find in the gallery (Non-gallery)**, and create it.

**2. Copy the tenant URL and token from Scoutworks**

In the Scoutworks wizard, at **Set up provisioning**, copy the **tenant URL** and the **secret token**. The token is shown once: if you lose it, rotate it and paste the new one.

The tenant URL looks like this, with your connection's ID in place of `{connectionId}`:

```text theme={null}
https://api.scoutworks.app/scim/v2/{connectionId}?aadOptscim062020
```

Keep `?aadOptscim062020` on the end. It switches Entra's provisioning job to its standards-compliant SCIM behaviour (lower-case operations, real `true` and `false`, one `replace` per change, and group member removal by path). Scoutworks accepts Entra's older behaviour too, because on-demand provisioning ignores the flag, but the flagged form is the one Microsoft supports going forward.

**3. Connect Entra to Scoutworks**

In the application, open **Provisioning**, set **Provisioning Mode** to **Automatic**, and under **Admin Credentials** paste the **Tenant URL** and **Secret Token**. Press **Test Connection**, then **Save**.

Test Connection sends a request with a user name that does not exist. Scoutworks answers with an empty list, which is what Entra expects.

**4. Check the attribute mappings**

Open **Mappings → Provision Microsoft Entra ID Users**. Scoutworks reads these attributes and ignores every other one, so you can leave Entra's other default mappings in place:

| Entra attribute | Scoutworks attribute | Notes |
| - | - | - |
| `userPrincipalName` (or `mail`) | `userName` | Must be an email address. Use `mail` if your UPNs are not real addresses. |
| `objectId` | `externalId` | **Change this.** Entra maps `mailNickname` by default. `objectId` lets a person's sign-in find the record Entra provisioned. |
| `Switch([IsSoftDeleted], …)` | `active` | Keep Entra's default. `False` suspends the person; `True` restores them. |
| `givenName` | `name.givenName` | |
| `surname` | `name.familyName` | |
| `displayName` | `displayName` | Shown only. |
| `jobTitle` | `title` | Shown only. |
| `mail` | `emails[type eq "work"].value` | |
| `mobile` | `phoneNumbers[type eq "mobile"].value` | Fills the person's phone in Scoutworks only when it is empty. |
| `employeeId` | `urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:employeeNumber` | Their Scout membership number, if you keep it in Entra. Fills it only when it is empty. |

Then open **Provision Microsoft Entra ID Groups**. Keep `displayName` → `displayName`, `objectId` → `externalId` and `members` → `members`. Each group's `displayName` must be unique among the groups you assign.

The full list is in the [SCIM reference](https://developers.scoutworks.app/scim-sso/scim-reference.md#user-attributes).

**5. Choose who is provisioned**

Under **Settings → Scope**, keep **Sync only assigned users and groups**. Then open **Users and groups** and assign the Microsoft 365 groups that hold your volunteers, for example "Beaver leaders" and "Trustees". Assigning a group sends its members and the group itself, so you can map it to a role in Scoutworks.

Never assign everyone in your tenant. Scoutworks gives access only to people in a mapped group (or the connection's default access, if you set one), but every assigned person is sent and stored.

**6. Try one person first**

With the connection still in **testing** in Scoutworks, use **Provision on demand** on one person. Scoutworks records them but gives nobody access yet. You should see them in the wizard's preview.

**7. Map groups, preview and turn it on**

Back in Scoutworks, map each directory group to a role, sections and job flags, check the preview, and turn the connection on. Then set **Provisioning Status** to **On** in Entra. Entra's first cycle sends everyone assigned; after that it sends changes about every 40 minutes.

### What each change in Entra does

| In Entra | In Scoutworks |
| - | - |
| Assign a person, or add them to an assigned group | Created, and given the access their mapped groups grant |
| Change their name, email or groups | Updated at the next cycle |
| Unassign them, block them, or delete them (soft delete) | `active` becomes false: their access is suspended in the groups this connection manages |
| Delete them for good (after Entra's 30-day soft delete) | Removed from the groups this connection manages |
| Assign them again within 30 days | Their access and history come back |

A change that would take away the access of more than a set share of the people the connection manages, in a short time, pauses the connection instead. See [Circuit breaker](https://developers.scoutworks.app/scim-sso/safety.md#circuit-breaker).

## 3. Set up sign-in

### OpenID Connect (recommended)

Scoutworks signs people in through your tenant only: the issuer is pinned to your tenant ID, and a token from any other tenant is refused.

**1. Give Scoutworks your tenant ID**

In the wizard, at **Set up sign-in**, choose **OpenID Connect** and paste your **Directory (tenant) ID** from the Entra overview page.

**2. Consent**

By default, sign-in uses Scoutworks' own Microsoft application. The first time someone signs in, Microsoft asks for consent to "Sign you in and read your profile" (`openid`, `email`, `profile`). If your tenant does not let users consent to applications, an admin consents once on behalf of the whole organisation: Microsoft offers that when an admin is the one signing in, for example in **Test sign-in** below.

**3. Test sign-in**

Press **Test sign-in**. It opens a popup, signs you in through Entra and shows the result. It must pass before you can go on. It does not start a Scoutworks session.

**If your tenant blocks third-party applications**, register your own instead: in **App registrations → New registration**, choose **Accounts in this organizational directory only**, and add this **Web** redirect URI:

```text theme={null}
https://api.scoutworks.app/api/auth/sso/tenant/callback
```

Create a client secret, and paste the **Application (client) ID** and the secret into the wizard. Scoutworks stores the secret encrypted and never shows it again. Remember to replace it before it expires.

**Multi-factor.** When Entra says the person used a second factor (`amr` includes `mfa`), that sign-in satisfies your Scoutworks MFA policy. Otherwise Scoutworks asks for its own second factor, as for any sign-in.

### SAML (the alternative)

Use SAML if your organisation standardises on it. In the enterprise application, open **Single sign-on → SAML** and give Entra the values the wizard shows:

| Entra field | Value |
| - | - |
| Identifier (Entity ID) | `https://api.scoutworks.app/api/auth/saml/{connectionId}/metadata` |
| Reply URL (Assertion Consumer Service URL) | `https://api.scoutworks.app/api/auth/saml/{connectionId}/acs` |
| Sign on URL | `https://api.scoutworks.app/api/auth/sso/tenant/{connectionId}/start` |

Keep Entra's default claims. Scoutworks reads the email, given name and surname claims, and the `objectidentifier` claim as the person's ID (the defaults are listed in [Limits](https://developers.scoutworks.app/scim-sso/limits.md#saml-defaults)). Then give Scoutworks Entra's **App Federation Metadata Url**: Scoutworks reads it again every day, so a new signing certificate is picked up on its own. Two certificates can be live at once while Entra rolls one over.

### A tile in My Apps

Volunteers can start from their Microsoft My Apps page. With SAML, the tile works once single sign-on is set up. With OpenID Connect, set the provisioning application's **Single sign-on** mode to **Linked**, with this sign-on URL:

```text theme={null}
https://api.scoutworks.app/api/auth/sso/tenant/{connectionId}/initiate
```

## Next

* [Require work-account sign-in](https://developers.scoutworks.app/scim-sso/safety.md#requiring-work-account-sign-in), with break-glass admins.
* Let a district's directory provision its groups: [Delegated provisioning](https://developers.scoutworks.app/scim-sso/safety.md#delegated-provisioning).
* Rotate the SCIM token: **Rotate token** in Scoutworks gives a new one, and the old one keeps working for 7 days while you paste it into Entra.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.