Request Lifecycle
Session Enforcement
The Orchestrator checks session timeouts on every request before processing it. These hooks let you apply custom timeout logic.evalMaxLifetimeSE is checked first, followed by evalIdleTimeoutSE. If either hook returns true, the session is terminated and the user is redirected back to the same URL, which triggers a fresh session.
Single Logout
The single logout flow processes each configured identity provider’s logout sequentially before terminating the session. When configured,postLogoutSE replaces the default post-logout behavior. You have full control over the response — redirect to a custom page, clean up external resources, or send notifications.
Hooks
evalIdleTimeoutSE
Decide whether a session should expire based on how long the user has been inactive. Return true to end the session, or false to keep it active. Use this to apply different idle timeouts based on user role, risk level, or which application the user is accessing.
Signature:
session.lifetime.evalIdleTimeoutSE
Parameters:
| Parameter | Type | Description |
|---|---|---|
api | orchestrator.Orchestrator | Access to sessions, caches, secrets, logging, and other Orchestrator services |
rw | http.ResponseWriter | The HTTP response writer for the current request |
req | *http.Request | The incoming HTTP request |
lastActivity | time.Time | Timestamp of the user’s last activity |
bool — true if the session should be expired due to idle timeout, false to keep it active.
evalMaxLifetimeSE
Decide whether a session should expire based on how long it has been active, regardless of user activity. Return true to end the session, or false to keep it active. Use this to enforce different session lifetimes based on authentication strength, user role, or compliance requirements.
Signature:
session.lifetime.evalMaxLifetimeSE
Parameters:
| Parameter | Type | Description |
|---|---|---|
api | orchestrator.Orchestrator | Access to sessions, caches, secrets, logging, and other Orchestrator services |
rw | http.ResponseWriter | The HTTP response writer for the current request |
req | *http.Request | The incoming HTTP request |
sessionStart | time.Time | Timestamp when the session was created |
bool — true if the session should be expired due to max lifetime, false to keep it active.
postLogoutSE
Run custom logic after the user has been logged out of all identity providers. Use this to clean up external resources, send notifications to downstream systems, record an audit event, or redirect the user to a custom post-logout page.
Signature:
singleLogout.postLogout.postLogoutSE
Parameters:
| Parameter | Type | Description |
|---|---|---|
api | orchestrator.Orchestrator | Access to sessions, caches, secrets, logging, and other Orchestrator services |
rw | http.ResponseWriter | The HTTP response writer — use to redirect or return a custom response |
req | *http.Request | The incoming HTTP request |