Tags give the ability to mark specific points in history as being important
-
1.0.5
d0701879 · ·1.0.5 — the login path, after review Security and correctness on the login endpoint, answering the security advisory coverage review (projectapplications#3618652, comments #6 and #13). No API changes, no configuration changes, no update hook. - The per-user flood counter is keyed on the account id plus the client IP rather than on the name as typed, as core's UserAuthenticationController::getLoginFloodIdentifier() does. The identifier column of the flood table is ASCII, so a non-ASCII user name made isAllowed() throw on MySQL and MariaDB and cost that account a 500 with the right password; the same column compares case-sensitively on PostgreSQL and SQLite, where user names do not, so two spellings of one name kept two counters. A name matching no account is keyed on a case-folded SHA-256 of it rather than given no counter, which is where this departs from core deliberately: these endpoints answer every login failure identically, and a name that can be flooded into a 429 is a name that exists. - The hash an unknown user is verified against is produced by the site's own password service and kept in state, instead of a constant at bcrypt cost 10. PHP hashes at cost 12 from 8.4, and verifying against the constant returned in roughly a quarter of the time a real check took -- a latency difference that told a known name from an unknown one, which is what the constant was there to prevent. It is regenerated whenever needsRehash() reports it outdated. - A successful login rehashes a password whose stored hash is outdated, as core's UserAuthentication::authenticateAccount() does. A user who only ever signed in through /auth/token kept the hash their account was created with through any later change of algorithm or cost. The account save this performs is marked so that hook_user_update() does not read it as a new password and revoke the user's other refresh tokens: the day a site changes its hashing settings should not be a mass logout. - The settings form carries its bounds as #min and #max on the number elements and validateForm() is gone. The two lifetimes had a ceiling and no floor, so a negative lifetime was saved; they are now 60 to 86400 seconds for the access token and 300 to 2592000 for the refresh token. Stored configuration is left alone, but a site that had set a lifetime below one of those floors will have to raise it the next time it saves the form. Also in this release, from the first round of the same review: the hooks are class methods with #[LegacyHook] wrappers for 10.3 to 11.0, the settings form maps onto configuration with #config_target, and the comments that had stopped describing the code are gone. Verified on Drupal 11.4.5 / PHP 8.4.1: 62 tests and 338 assertions green, up from 58 and 306, PHPCS clean against Drupal and DrupalPractice, PHPStan level 6 as a blocking gate. All thirteen jobs green on drupal.org pipeline 959419, previous major and newest supported PHP included.
-
1.0.4
cf540a69 · ·1.0.4 — instructions that match the form, and the trap next door Documentation, plus one piece of contextual help. No code path changes, no configuration changes, no breaking changes. - The quick start described a "Generate a key" button that does not exist for a JWT key: KeyFormBase derives the input widget from the key type, and JwtHsKeyType pins it to a plain text field, so the reader has to bring their own secret. Two further details were wrong — the field is titled "JWT Algorithm" and appears only once the key type is chosen, and there are two distinct "Base64-encoded" checkboxes, one encoding the secret at rest and one declaring that what you paste is already base64. Ticking the wrong one gives a key that validates and then fails to sign. Found the way the previous release was: someone following the instructions as written rather than as remembered. - The settings form now explains, beside the login-injection checkbox, that jwt_auth_issuer ships "Include a JWT token in the user login response" enabled, and that the token it adds cannot be renewed — a login that works until it expires. Of the four combinations only that default is a trap, so the advice is to uncheck it unless core's login route is used deliberately. Not put on the status report: both settings sit at their shipped defaults, so such a warning would fire on every fresh install, including the sites that never call /user/login. Verified on Drupal 10.6.10 / PHP 8.2 and Drupal 11.4.5 / PHP 8.4.1: 56 tests, PHPCS clean against Drupal and DrupalPractice, PHPStan level 6 as a blocking gate, and all thirteen jobs green on drupal.org pipeline 933553 — cspell included, checked locally before the push this time.
-
1.0.3
02dd2ff9 · ·1.0.3 — a quick start that was actually run, and a log that says why Documentation and diagnostics. No behavior change in the endpoints, no configuration change, no breaking change. Both changes come from the same exercise: installing the published 1.0.2 from drupal.org into a fresh Drupal 11 site and following the README as a newcomer would, rather than as its author. - The README leads with a six-step quick start, each step executed on that site before being written down, with the real request and response bodies. The previous instruction hid the only step that takes work — creating the signing key means two forms in two other modules — behind a sentence that sounded like there was none. Two behaviors newcomers reasonably mistake for bugs are now stated up front: a default logout leaves the access token valid until it expires, and five failed logins lock an account for six hours. - The log entry explaining why a token could not be issued was written inside the transaction that the failure then rolls back, so it was discarded with it. The only surviving entry named no cause, and the HTTP response is deliberately a bare 500, so there was nowhere left to look. The reason is now logged after the rollback. Verified on Drupal 10.6.10 / PHP 8.2 and Drupal 11.4.5 / PHP 8.4.1: 56 tests, PHPCS clean against Drupal and DrupalPractice, PHPStan level 6 as a blocking gate, and all thirteen jobs green on drupal.org pipeline 933450.
-
1.0.2
a88b7c93 · ·1.0.2 — a keyless login no longer fails a login that succeeded One fix, no configuration change and no breaking change. - UserLoginInterceptSubscriber called JwtAuth::generateToken() unguarded, so on a site with no usable signing key POST /user/login?_format=json answered 500 — after core had already authenticated the account. The client saw a failure for a login that had in fact succeeded. The response is now left exactly as core built it and the failure is logged, which is what the same call site in TokenController has been doing all along. - The FALSE checks around both calls were dead code. generateToken() is documented "@return string|bool ... False if there is a problem encoding" but returns the transcoder's ?string, so a missing key yields NULL. Both sites now reject any non-string, which keeps the typed 500 internal_error on /auth/token correct once the upstream fatal is fixed and NULL starts coming back. The root cause is upstream: drupal/jwt raises an Error from inside its transcoder when no key is configured. Reproduced, reviewed and patched on https://www.drupal.org/project/jwt/issues/3409096 — this release is correct whether or not that lands. Verified on Drupal 10.6.10 / PHP 8.2 and Drupal 11.4.5 / PHP 8.4.1: 56 tests, PHPCS clean against Drupal and DrupalPractice, PHPStan level 6 as a blocking gate, and all thirteen jobs green on drupal.org pipeline 933436.
-
1.0.1
17e5c921 · ·1.0.1 — API contract and a missing-key warning Two fixes, both found by installing the published 1.0.0 from drupal.org into a fresh Drupal 11 site and exercising every endpoint. - POST /auth/token/revoke answered an HTML access-denied page when no Authorization header was presented, breaking the promise that every error is a JSON envelope with a stable code. It now returns 401 invalid_token with WWW-Authenticate: Bearer. - A missing JWT signing key is reported on the status report. Previously the first symptom was a 500 raised inside drupal/jwt on any Bearer request. Verified on Drupal 10.6.10 / PHP 8.2 and Drupal 11.4.5 / PHP 8.4.1: 53 tests, PHPCS clean against Drupal and DrupalPractice, PHPStan level 6 as a blocking gate, and all thirteen jobs green on the drupal.org pipeline.
-
1.0.0
ae772b3b · ·1.0.0 — initial public release JWT login, refresh token rotation with OWASP reuse detection, and optional server-side revocation for immediate logout, for decoupled Drupal. Verified on Drupal 10.6.10 / PHP 8.2 and Drupal 11.4.5 / PHP 8.4.1, and by the drupal.org pipeline on the current core, the previous major and the maximum supported PHP: 50 tests, PHPCS clean against Drupal and DrupalPractice, PHPStan level 6 as a blocking gate.