---
title: 'Syncing groups and roles from single sign-on (SSO)'
description: 'How to link the groups in your identity provider, such as Entra ID group ids, to MediaLab groups and user roles, so access follows your organization''s directory.'
url: https://www.medialab.co/support/account/user-management/sso-group-and-role-sync
---

# Syncing groups and roles from single sign-on (SSO)

With single sign-on (SSO), you can let your organization's directory decide what users can access in MediaLab. Your identity provider (IdP), such as Microsoft Entra ID or Okta, tells MediaLab which groups a user is in when they log in. You link those groups to MediaLab [groups](https://www.medialab.co/support/account/roles-permissions/user-access-to-folders) and [user roles](https://www.medialab.co/support/account/roles-permissions/user-roles), and MediaLab gives the user the matching folder access and permissions.

For example: everyone in the Entra ID group *Marketing* gets the MediaLab role *Marketing editor*, and everyone in *Press office* gets access to the *Press* folder.

### What you need

- The single sign-on add-on, with a working connection. See [Adding single sign-on (SSO) users](https://www.medialab.co/support/account/user-management/adding-sso-users).
- An identity provider that sends the user's groups in the `groups` claim of the ID token. This works with Microsoft Entra ID, Okta and other OpenID Connect providers that include this claim. Google and Auth0 connections don't send groups.
- For roles: the user roles add-on.

### 1. Send the groups from your identity provider

Set up your identity provider to include the groups claim:

- **Microsoft Entra ID**: in the app registration, go to **Token configuration**, click **Add groups claim** and choose the groups to include, for example **Security groups**. Entra ID sends the **group object id**, a long code such as `3f2b8c1e-...`, not the group name. You find it on the group's **Overview** page in Entra ID.
- **Okta**: add a groups claim to the ID token of your authorization server, for example with a filter on the groups that are relevant for MediaLab. Okta usually sends group names.
- **Other OpenID Connect providers**: add the groups to a claim named `groups` in the ID token.

Send only the groups MediaLab needs. Some providers limit the number of groups in a token, and leave them out when a user is in too many.

### 2. Turn on group retrieval in MediaLab

1. Go to **Settings** → **Single Sign On (SSO)**.
2. Turn on **Retrieve user groups?**.
3. Choose what **Permissions synchronization** updates: **Groups only**, **Roles only**, or **Roles, groups**.
4. Turn on **Synchronize permissions on login?** to update existing users at every login. When it's off, the groups only decide the role and groups of new users, on their first login.
5. Click **Save**.

### 3. Link the groups to MediaLab groups and roles

Enter the values exactly as your identity provider sends them: for Entra ID the group object id, for Okta usually the group name. Separate several values with a comma or a new line.

- **Groups**: go to **Settings** → **Groups**, edit a group and enter the values under **SSO groups**. A user who matches several groups gets all of them.
- **Roles**: go to **Settings** → **User roles**, edit a role and enter the values under **SSO groups**. A user who matches several roles gets the one with the highest level.

### What happens at login

For a new user, created on their first login:

- With **Roles only** or **Roles, groups**, the user gets the role that matches their groups. Without a match, they get the default role you set under **New users** in the SSO settings.
- Without a role, they get the default level and permissions, plus the groups that match. Without a matching group, they get the default groups.

When **Synchronize permissions on login?** is on, existing users are updated at every login:

- **Roles only**: the user gets the matching role. Without a match, their role is removed.
- **Roles, groups**: the same, and a user without a matching role gets the matching groups instead.
- **Groups only**: the user's role is removed and their groups are replaced by the matching groups.

Changes you make to these users in MediaLab are overwritten at their next login. Be careful with **Groups only**: a user who matches no group loses all their groups, and with that their access to folders. Media managers, administrators and owners already see all folders, so their groups aren't changed.

You can also use **Required SSO groups** in the SSO settings to only let members of certain groups log in at all.

### Checking what a user received

To see which groups the identity provider sent for a user, go to **Settings** → **Users** and click **User settings** next to the user. **Member SSO groups** lists the values from their last login. Compare them with the values on your groups and roles if a user doesn't get the access you expect.

### Read more

- [Adding single sign-on (SSO) users](https://www.medialab.co/support/account/user-management/adding-sso-users)
- [User roles](https://www.medialab.co/support/account/roles-permissions/user-roles)
- [User access to folders](https://www.medialab.co/support/account/roles-permissions/user-access-to-folders)
