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.

2.0.0(1mo ago)043.0k↓49.8%2GPL-2.0-or-laterPHPCI failing

Since Jan 17Pushed 1mo 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 2.x Synced 3d ago

READMEChangelog (6)Dependencies (18)Versions (8)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

52

—

FairBetter than 96% of packages

Maintenance88

Actively maintained with recent releases

Popularity29

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 69.8% 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 ~383 days

Recently: every ~432 days

Total

7

Last Release

59d ago

Major Versions

1.0.3 → 2.0.02026-05-06

### 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)")[![idimopoulos](https://avatars.githubusercontent.com/u/12171851?v=4)](https://github.com/idimopoulos "idimopoulos (1 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

[drevops/behat-steps

Collection of steps for Behat

27432.0k4](/packages/drevops-behat-steps)[vitalybaev/laravel5-dkim

Laravel 5/6 package for signing outgoing messages with DKIM.

3163.1k](/packages/vitalybaev-laravel5-dkim)

PHPackages © 2026

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