Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Release: Opensolr Search 4.5.0 Minor update available for module opensolr_search (4.5.0). Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Usage Milestone: Simplify Module simplify crossed 10,000 active installs. Usage Milestone: Views Reference Filter Module entityreference_filter crossed 10,000 active installs. Usage Milestone: Dropdown Language Module dropdown_language crossed 10,000 active installs. Usage Milestone: Paragraphs Browser Module paragraphs_browser crossed 10,000 active installs. Usage Milestone: OpenAPI Module openapi crossed 10,000 active installs. Usage Milestone: Decoupled Router Module decoupled_router crossed 10,000 active installs. Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

OTP Service

2 sites No security coverage Drupal 10–11
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.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

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

Releases

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