Drupal is a registered trademark of Dries Buytaert
Better Exposed Filters 7.1.3 Minor update available for module better_exposed_filters (7.1.3). Resource Description Framework (RDF) 4.0.0 Major update available for module rdf (4.0.0). Mailer Plus (DSM+) 2.0.2 Minor update available for module symfony_mailer (2.0.2). Simple hierarchical select 2.0.6 Minor update available for module shs (2.0.6). Chaos Tool Suite (ctools) Module ctools crossed 1,000 active installs. Panels 8.x-4.10 Module panels updated after 15 months of inactivity (8.x-4.10). JSON:API Frontend 1.0.13 Minor update available for module jsonapi_frontend (1.0.13). PDF printing with template 1.1.19 Minor update available for module fpdi_print (1.1.19). DXPR Builder: The AI Visual Page Builder for Drupal 3.0.0-beta16 New beta version released for module dxpr_builder (3.0.0-beta16). Block Visibility Groups 2.0.5 Module block_visibility_groups updated after 18 months of inactivity (2.0.5).

If you are evaluating this module for use, please read this issue.

Overview

The Route Basic Authentication module protects configured routes with HTTP basic authentication. The routes are configured with the Drupal route name (described as machine name in the structure of routes documentation), for example the login: user.login. The HTTP methods (GET, POST, PUT, DELETE, ...) that should be protected by HTTP basic authentication are also configured for each route. A site wide username and password is used, configurable on the settings page (Administration » Configuration » System » Route Basic Authentication settings).

Features

  • Protect configured Drupal routes with HTTP basic authentication.
  • Protected route HTTP methods configurable.
  • Site wide username and password for HTTP basic authentication.
  • IP address based flood protection.

Installation

Install as you would normally install a contributed Drupal module. Visit:
https://www.drupal.org/docs/8/extending-drupal-8/installing-drupal-8-mod...
for further information.

Configuraton

  • Configure user permissions in Administration » People » Permissions:
    • Change the Route Basic Authentication settings:
      Permission to change the module settings.
  • Configure username and password on the settings page or route_basic_auth.settings.yml configuration file.
  • Configure the routes that should be protected with HTTP basic authentication in the route_basic_auth.settings.yml configuration file (Currently not editable in the UI).
    • Use the following format:
      protected_routes:
            # The name of the key, here "user_login" does not matter.
            user_login:
              name: 'user.login'
              methods:
                - 'GET'
            user_login_http:
              name: 'user.login.http'
              methods:
                - 'POST'

Requirements

  • This module requires Drupal 8.6 or above.
  • No additional modules are needed.

Example use cases

  • Protect the login page with HTTP basic authentication to add an extra layer of security.
  • Protect a webhook endpoint for incoming requests from a service such as MailJet.
  • ...

Related modules

  • Shield: Protects pages with HTTP basic authentication - now has path inclusion/exclusion capabilities.
  • HTTP Auth: Protects /user and /admin pages with HTTP basic authentication.

Activity

Total releases
1
First release
Jul 2026
Latest release
1 hour ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Active

Releases

Version Type Release date
2.1.0-beta1 Pre-release Jul 25, 2026