You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ffe22bb
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: UPGRADING.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,12 @@ value. The command does not modify either file. Accounts with older password
26
26
hash settings can still have different verification times until their hashes
27
27
are upgraded.
28
28
29
+
### HMAC Token Expiration Enforcement
30
+
31
+
HMAC tokens with an explicitly configured expiration date are now rejected during authentication once they have expired. Previously, the `HmacSha256` authenticator did not enforce the configured expiration date, allowing expired tokens to remain usable if their signatures were valid.
32
+
33
+
HMAC tokens without an explicitly configured expiration date retain their existing behavior and remain subject to the configured `unusedTokenLifetime` restriction.
Copy file name to clipboardExpand all lines: docs/references/authentication/hmac.md
+7-2Lines changed: 7 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -99,7 +99,9 @@ $user->revokeAllHmacTokens();
99
99
100
100
## Expiring HMAC Keys
101
101
102
-
By default, the HMAC keys don't expire unless they reach the HMAC keys' lifetime expiration after their last use date.
102
+
By default, HMAC keys do not have a fixed expiration date. However, they will expire if they exceed the configured lifetime since their last use.
103
+
104
+
You can also assign an explicit expiration date to an HMAC key. When an expiration date is set, Shield automatically checks it during authentication and rejects the key once it has expired.
103
105
104
106
HMAC keys can be set to expire through the `generateHmacToken()` method. This takes the expiration date as the `$expiresAt` argument. To update an existing HMAC key expiration date, use `updateHmacTokenExpiration($hmacTokenID, $expiresAt)`. To remove it, use `removeHmacTokenExpiration($hmacTokenID)`.
105
107
@@ -287,7 +289,10 @@ public $unusedTokenLifetime = YEAR;
287
289
288
290
### HMAC Keys Expiration vs Lifetime
289
291
290
-
Expiration and lifetime are two different concepts. The lifetime is the maximum time allowed for the HMAC Key to exist since its last use. HMAC Key expiration, on the other hand, is a set date in which the HMAC Key will cease to function.
292
+
Expiration and lifetime are two different concepts.
293
+
294
+
The lifetime is the maximum period of inactivity allowed for an HMAC key, measured from its last use. Once this period is exceeded, the key is rejected.
295
+
Expiration, on the other hand, is a fixed date and time after which the HMAC key can no longer be used, regardless of its last use.
0 commit comments