Reputation: 10587
I keep getting following error in my JSF application when I leave app sitting in browser for some time, then try using it again;
com.ibm.websphere.servlet.session.UnauthorizedSessionRequestException: SESN0008E: A user authenticated as anonymous has attempted to access a session owned by user:localRealm/uid=testUser,ou=People,o=internet.
My Liberty settings.xml file has following settings that could be related:
<ltpa expiration="1200" />
<webAppSecurity logoutOnHttpSessionExpire="true" singleSignonEnabled="true" />
My web.xml has
<session-config>
<session-timeout>60</session-timeout>
</session-config>
What is causing this error and how to resolve it?
Upvotes: 0
Views: 906
Reputation: 10587
I figured it out.
SESN0008E happens when LTPA token expires before than user session (HttpSession in your app) expires.
In JSF, we normally have Http session expiration time set in web.xml file like:
<session-config>
<session-timeout>60</session-timeout>
</session-config>
This means user session (HttpSession) will expire in 60 minutes.
For Liberty (Websphere or Openliberty), we typically set LTPA token expiration in server.xml file like:
<ltpa expiration="120" />
This means that Libety LTPA token will expire in 120 minutes.
REPRODUCTION STEPS
ltpa expiration="1"
to set it to 1 minutesession-timeout
to 5 minutes. (This will make your ltpa token expire before your Http session expires.)SOLUTION
<httpSession invalidateOnUnauthorizedSessionRequestException="true"/>
MORE INFORMATION
https://www.ibm.com/support/pages/logging-out-results-websphere-application-server-error-message this
https://www.ibm.com/docs/en/ftmfm/3.2.3?topic=center-ltpa-timeout-session-management
https://knowledge.broadcom.com/external/article/31342/session-killed-by-agent-heartbeat.html
https://erikwramner.wordpress.com/2016/03/06/handle-unauthorizedsessionrequestexception-was-8-5-5/
https://www.ibm.com/docs/en/was-liberty/base?topic=configuration-httpsession
Upvotes: 3