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

# Connect your directory

> Let Valar see the people and groups your identity provider sends, so groups can decide routing and a deactivation ends a sign-in

Private Preview

Your directory tells Valar who is in your organization and which groups they are in. With it
connected, directory groups can decide how each engineer's [ValarCode requests route](https://docs.valarhq.ai/valarcode/sso.md#route-by-group-or-person),
and deactivating or removing someone in your identity provider ends their sign-in.

Connecting a directory needs [single sign-on](https://docs.valarhq.ai/access/sso.md) connected and
[SSO sign-in for ValarCode](https://docs.valarhq.ai/valarcode/sso.md) on; the **Directory** section appears under **Access**
once it is. Only admins can connect one.

## Connect

1. Open **Settings → Directory** and click **Connect directory**. A setup page walks you through
   connecting your identity provider's directory.
2. In your identity provider, turn on provisioning to Valar: create users, update them, and
   deactivate them. Without deactivation, a suspension never reaches Valar.
3. Push the groups you plan to route by. A group that is assigned to the app but not pushed does
   not reach Valar.

To change or disconnect the connection later, click **Manage directory** on the same page.

## What the page shows

People and groups appear on the **Directory** page within about a minute of each change in your
identity provider. **Users** lists each person's email, groups, and last sign-in; search by email or
filter by group. **Groups** lists each group with its members.

Only your identity provider can show whether a push finished. If someone is missing on the
**Directory** page, check the push there first.

## Roles from directory groups

Your directory groups can decide each person's role in Valar:

1. Open **Settings > Directory**, click **Manage directory**, then **Configure role assignment**.
2. Pick a role for each group: Admin, Member, Read, or ValarCode Viewer. Click **Continue** to
   save. Map at least one group you are in to Admin.
3. Open **Settings > Sign-in & SSO** and turn on **Roles from directory groups**.

From then on, each person gets their group's role every time they sign in, and roles can no longer
be changed under **Team members**. Someone in several mapped groups gets the highest of their roles,
in the order Admin, Member, Read, ValarCode Viewer. Someone in no mapped group gets Member. A
mapping change can take up to an hour to apply. Valar never removes your last admin this way.

## When someone leaves

Deactivate or remove the person in your identity provider. Within about a minute they leave the
**Directory** page and their ValarCode sign-in ends. What happens to the selections that covered
them is on the [ValarCode SSO page](https://docs.valarhq.ai/valarcode/sso.md#when-someone-leaves).


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