## Missing OIDC Feature: `max_age` Validation
### Status
`auth_time` claim is now implemented and included in ID tokens, but the server-side `max_age` validation on the `/authorize` endpoint is missing.
### What's Implemented
- `auth_time` is stored in session when user authenticates (`session[:auth_time]`)
- `auth_time` is included in ID token claims (as Unix timestamp)
- Clients can validate `auth_time` on their end
### What's Missing
Per OIDC Core §2, when the client sends `max_age` parameter to `/authorize`:
**Expected behavior:**
- If `auth_time` ≤ `max_age` seconds ago → Proceed silently (SSO)
- If `auth_time` > `max_age` seconds ago → Force re-authentication (show login screen)
**Current behavior:**
- The `max_age` parameter is not validated
- Users with old sessions proceed regardless of `max_age`
### Implementation Notes
The authorize flow currently has two states:
1. User not logged in → redirect to login
2. User logged in → proceed (or show consent if needed)
Adding `max_age` support requires a third state:
3. User logged in **but session is too old** → force re-auth
### Related Code
- `/oauth/authorize` endpoint in `app/controllers/oidc_controller.rb:48`
- Session auth_time set in `app/controllers/concerns/authentication.rb:53`
- ID token generation in `app/services/oidc_jwt_service.rb:6`
### Spec Reference
- [OpenID Connect Core §2](https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest) - `max_age` parameter
- [OpenID Connect Core §2](https://openid.net/specs/openid-connect-core-1_0.html#IDToken) - `auth_time` claim
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Missing OIDC Feature:
max_ageValidationStatus
auth_timeclaim is now implemented and included in ID tokens, but the server-sidemax_agevalidation on the/authorizeendpoint is missing.What's Implemented
auth_timeis stored in session when user authenticates (session[:auth_time])auth_timeis included in ID token claims (as Unix timestamp)auth_timeon their endWhat's Missing
Per OIDC Core §2, when the client sends
max_ageparameter to/authorize:Expected behavior:
auth_time≤max_ageseconds ago → Proceed silently (SSO)auth_time>max_ageseconds ago → Force re-authentication (show login screen)Current behavior:
max_ageparameter is not validatedmax_ageImplementation Notes
The authorize flow currently has two states:
Adding
max_agesupport requires a third state:3. User logged in but session is too old → force re-auth
Related Code
/oauth/authorizeendpoint inapp/controllers/oidc_controller.rb:48app/controllers/concerns/authentication.rb:53app/services/oidc_jwt_service.rb:6Spec Reference
max_ageparameterauth_timeclaim