Drupal is a registered trademark of Dries Buytaert
Release: Leaflet 10.4.11 Minor update available for module leaflet (10.4.11). Release: Session Inspector 1.0.8 Minor update available for module session_inspector (1.0.8). Release: Migrate QA 2.0.4 Minor update available for module migrate_qa (2.0.4). Release: CKEditor Description List 3.0.0 Major update available for module ckeditor_descriptionlist (3.0.0). Release: FlowDrop 2.4.0 Minor update available for module flowdrop (2.4.0). Release: JWT Token Refresh 1.0.4 Minor update available for module jwt_token_refresh (1.0.4). Release: ConReg 1.0.0-beta1 First beta version released for module conreg (1.0.0-beta1). Release: AI Image Studio 1.0.0-beta8 New beta version released for module ai_image_studio (1.0.0-beta8). Usage Milestone: Role Theme Switcher Module role_theme_switcher crossed 1,000 active installs. Module Revived: Decoupled Router 2.0.7 Module decoupled_router updated after 11 months of inactivity (2.0.7).

This module enhances SAML Authentication by restricting site access based on Organizational Unit (OU) attributes provided by your Identity Provider. It's ideal for large organizations, allowing administrators to control access based on Active Directory groups without managing individual Drupal roles. The module supports parsing complex Distinguished Names, offers strict (AND) or flexible (OR) OU matching, and allows customization of the access denied message.

SAML Authentication Restrict to OU provides a security layer for the SAML Authentication module by restricting site access based on Organizational Unit (OU) attributes sent by the Identity Provider (IdP).

This module is specifically designed for Enterprise environments using Active Directory, allowing administrators to limit site access to specific departments or groups within a large organization without the overhead of managing individual Drupal roles for every user.

Features

  • Restrict Login Toggle: A master switch that allows you to enable or disable the restriction logic globally without losing your settings.
  • Distinguished Name (DN) Parsing: Automatically extracts multiple OU values from complex DN strings commonly sent by Active Directory (e.g., CN=user,OU=Marketing,OU=Users...).
  • Strict Mode: Optionally require that a user belongs to all listed OUs rather than just one (AND vs OR logic).
  • Customizable Access Denied Message: Control the exact message shown to rejected users, with support for basic HTML markup to ensure visibility.

Requirements

This module requires the SAML Authentication module.

Installation

Install as you would normally install a contributed Drupal module. For further information, see Installing Drupal Modules.

Configuration

The configuration form is located at:

/admin/config/people/saml-restrict

From the configuration form you can:

  • Restrict Login to OUs: Enable the master toggle to begin enforcing restrictions.
  • SAML Attribute Name: Set this to the attribute containing your OU data. In most AD setups, this is dn.
  • Allowed OUs: Enter the names of authorized OUs, one per line (e.g., Staff, Faculty, Marketing). This check is case-insensitive to ensure reliable matching across directory updates. Do not include "ou=" prefixes.
  • Strict Mode: Check this if a user must be a member of every OU listed to gain access.
  • Access Denied Message: Customize the message displayed to users who are rejected. Basic HTML is supported.

Activity

Tracked releases
7
Tracked since
Apr 2026
Latest release
4 months ago
Releases (12 mo)
7 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Release date
1.0.5 Stable Apr 10, 2026
1.0.4 Stable Apr 10, 2026
1.0.3 Stable Apr 10, 2026
1.0.2 Stable Apr 10, 2026
1.x-dev Dev Apr 10, 2026
1.0.1 Stable Apr 10, 2026
1.0.0 Stable Apr 10, 2026