PHPackages                             drupaltest/behat-one-time-login - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. drupaltest/behat-one-time-login

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

drupaltest/behat-one-time-login
===============================

Authenticates users through the Drupal one time login mechanism.

1.0.3(2y ago)040.6k↓20.6%1GPL-2.0-or-laterPHP

Since Jan 17Pushed 2y ago5 watchersCompare

[ Source](https://github.com/drupaltest/behat-one-time-login)[ Packagist](https://packagist.org/packages/drupaltest/behat-one-time-login)[ Docs](https://github.com/drupaltest/behat-one-time-login)[ RSS](/packages/drupaltest-behat-one-time-login/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (9)Versions (6)Used By (0)

Behat One Time Login
====================

[](#behat-one-time-login)

Authenticates users through the Drupal one time login mechanism in Behat scenarios.

This is intended for projects that do not use the default Drupal login form but instead rely on 2-Factor Authentication, Single Sign On or other non-standard authentication methods.

Installation
------------

[](#installation)

Add the library to your development dependencies:

```
$ composer require --dev drupaltest/behat-one-time-login

```

Add the following to your `behat.yml` configuration file:

```
default:
  extensions:
    FriendsOfBehat\ServiceContainerExtension:
      imports:
        - "./vendor/drupaltest/behat-one-time-login/behat.services.yml"

```

Usage
-----

[](#usage)

This transparently replaces the standard login method, so in most cases it can be dropped in and used without requiring changes to existing test scenarios.

Do note that in the standard Drupal login procedure the user ends up on the homepage after logging in, and with this library they end up on the user profile page. We do not include a redirection to the homepage since in Behavior Driven Development the tests are supposed to be readable by business stakeholders. Non- technical users might not know that Drupal internally redirects to the homepage after logging in. This means that any tests that are performing actions on the homepage should have a step telling the user to open the homepage. For example:

```
Given I am logged in as an administrator
And I am on the homepage

```

Development
-----------

[](#development)

Running tests locally:

- Run `composer install` to get the codebase: ```
    $ composer install
    ```
- Create a customized `behat.yml`: ```
    $ cp behat.yml.dist behat.yml
    ```
- Adapt the values in `behat.yml` to your needs. You can keep the default Behat config and test using the PHP built-in web-server: ```
    $ ./vendor/bin/drush runserver 8888
    ```

    or use your local web-server if any. In this case, you'll need to set the appropriate configurations in `behat.yml`.
- Install Drupal: ```
    $ ./vendor/bin/drush site-install
    ```
- Run tests:

```
$ ./vendor/bin/behat
```

Credits
-------

[](#credits)

This is based on [weitzman/logintrait](https://gitlab.com/weitzman/logintrait/)by Moshe Weitzman.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 71.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~357 days

Total

5

Last Release

886d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2e8002bbd41b86bc1aa39bfd23074f88c0816d46e511fefa26701d176286d396?d=identicon)[pfrenssen](/maintainers/pfrenssen)

![](https://www.gravatar.com/avatar/a753aefee83a2962b5962cd13c64b377eaeb1e5950e4e2ecc11f773bdebac440?d=identicon)[jhedstrom](/maintainers/jhedstrom)

---

Top Contributors

[![pfrenssen](https://avatars.githubusercontent.com/u/442924?v=4)](https://github.com/pfrenssen "pfrenssen (30 commits)")[![claudiu-cristea](https://avatars.githubusercontent.com/u/473868?v=4)](https://github.com/claudiu-cristea "claudiu-cristea (11 commits)")[![prudloff-insite](https://avatars.githubusercontent.com/u/50333926?v=4)](https://github.com/prudloff-insite "prudloff-insite (1 commits)")

---

Tags

behatdrupal

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/drupaltest-behat-one-time-login/health.svg)

```
[![Health](https://phpackages.com/badges/drupaltest-behat-one-time-login/health.svg)](https://phpackages.com/packages/drupaltest-behat-one-time-login)
```

###  Alternatives

[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)[beatswitch/lock

A flexible, driver based Acl package for PHP 5.4+

870304.7k2](/packages/beatswitch-lock)[amocrm/amocrm-api-library

amoCRM API Client

182728.5k6](/packages/amocrm-amocrm-api-library)[vonage/jwt

A standalone package for creating JWTs for Vonage APIs

424.1M4](/packages/vonage-jwt)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
