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 404f201
Browse filesBrowse the repository at this point in the historyBrowse files
fix: verify auth_time against per-request max_age (#1792)
### Changes
`max_age` passed per call (e.g. `loginWithRedirect({
authorizationParams: { max_age: 0 } })`) was sent to `/authorize` but
not used when verifying the returned ID token. Only the `max_age` set on
the client was checked, so `auth_time` validation was skipped for
per-request `max_age`.
- `_prepareAuthorizeUrl` now returns the effective `max_age`; it is
stored in the login transaction (redirect) or kept in memory (popup,
silent iframe) and passed to `_verifyIdToken`, falling back to the
client-level value.
- `parseNumber('0')` now returns `0` instead of `undefined`.
- `verify()` now requires `auth_time` when `max_age` is `0`.
### References
[OIDC Core §3.1.3.7 — ID Token
Validation](https://openid.net/specs/openid-connect-core-1_0.html#IDTokenValidation),
item 13 (`auth_time` must be checked when `max_age` is requested).
### Testing
Added unit tests for per-request `max_age` in `loginWithRedirect`,
`loginWithPopup` and `getTokenSilently`, plus `max_age: 0` handling in
`jwt.verify` and `parseNumber`. The full unit suite passes.
- [x] This change adds unit test coverage
- [ ] This change adds integration test coverage
- [x] This change has been tested on the latest version of the
platform/language
### Checklist
- [x] I have read the [Auth0 general contribution
guidelines](https://github.com/auth0/open-source-template/blob/master/GENERAL-CONTRIBUTING.md)
- [x] I have read the [Auth0 Code of
Conduct](https://github.com/auth0/open-source-template/blob/master/CODE-OF-CONDUCT.md)
- [x] All code quality tools/guidelines have been run/followed
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* `max_age` settings are now applied consistently during popup,
redirect, and silent sign-ins. Values supplied for a specific sign-in
take precedence over the client’s configured value.
* A `max_age` of `0` is now preserved and enforced during ID token
verification, including the required `auth_time` claim check.
* Numeric string values for `max_age`, including `"0"`, are now
correctly recognized as numbers.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments