Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). Varbase Media Header 9.2.1 Minor update available for module varbase_media_header (9.2.1). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Content Translation Redirect Module content_translation_redirect crossed 1,000 active installs.

OTP Service

2 sites No security coverage
View on drupal.org

The OTP Service module adds one-time password (OTP) functionality to your Drupal site. It allows users to set up their OTP secret using a QR code with authenticator apps and provides a service to validate OTP codes entered by users, enabling you to protect specific pages or features.

Description

The OTP Service (otp_service) module provides a simple way to add OTP (One-Time Password) functionality to your application. This module provides a block that allows users to setup their secret using the scan of a QR Code and their preferred application (Google Authenticator, Microsoft Authenticator etc... ).
The secret is stored as a field in the user entity to be later retrieved for validation (this data IS NOT encrypted).
The module also allows to protect the access to a bundle by its service
The module also provides a service to validate user input OTP's in your application.
This way you can focus on your app functionality without worrying about OTP implementation.

Use Case

There is some page or functionality that you want to "protect".
Users log in using their password and email/username, no two factor authentication required.
When they access a certain page/feature, they have to provide a OTP to access it.

With this module you can provide a block to users so they can setup their secret with their preferred app.
You can then implement a custom form to collect the code their app provided and on submit of the input call the service this module provides to validation. You can then use the result of the validation (true/false) to manage the access to the page/feature.

Requirements

This module uses the pragmarx/google2fa package to generate secrets and validate OTP's.
The package will be automatically pulled via composer.

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.

Configuration

  • The module provides a block for the users to setup their OTP secret. Use Block Layout or another way to render the block where you want it.
  • The module provides a service to validate user input OTP's that you can use anywhere in your application.

Activity

Total releases
2
First release
Jan 2025
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 2
Maintenance
Dormant

Releases

Version Type Release date
2.0.0 Stable Jan 19, 2025
2.0.x-dev Dev Jan 19, 2025