Handle session expiry from upstream IdP (IPSIE `session_expiry`)
masterWhen an upstream Identity Provider (IdP) supports the IPSIE SL1 spec, it may include a session_expiry claim in the ID token. This claim is an absolute Unix timestamp (in seconds) marking when the IdP session expires.
SDK Behavior
If the session_expiry claim is present, the SDK automatically:
- Persists the value as
sessionExpiresAt(Unix seconds) on the session. - Rejects logins with an HTTP 400 if the expiry time is already in the past.
- Treats the session as expired once
sessionExpiresAtis reached (with a 30-second clock skew leeway). - Caps the session cookie lifetime at this ceiling.
- Throws a
SessionExpiredErrorduringaccessToken.refresh()calls.
Critical Requirement: Seconds vs Milliseconds
The session_expiry claim MUST be a Unix timestamp in seconds. If your IdP provides a millisecond timestamp, you must divide it by 1000.
- If the value is $\ge$
10,000,000,000(approx. year 2286), the SDK treats it as "no ceiling". - Non-integer, float, zero, or negative values will cause the check to fail open.