SESN0008E: A user authenticated as anonymous has attempted to access a session owned by user

♀尐吖头ヾ 提交于 2019-11-29 16:25:45

After studying the securityIntegrationEnabled="false workaround, I think I have figured out why things are working / not working.

The solution is actually very simple without changing the server.xml.

When the error SESN0008E occured, I was testing the FormAuth app using the common preview mode by clicking on the link from the admin console in the standalone server. Although the common preview link opened to a new browser, but the sessionID actually stays. Both browser tabs are in the same session (I checked).

It means that the sessionID that I am using is actually the one that was already authenticated by the Admin Console. And in my preview mode I tried to authenticate again in the session that was already "owned" by another user. This causes WAS to throw the error SESN0008E: A user authenticated as anonymous has attempted to access a session owned by user:BasicRegistry/demo. My app preview is in the same httpsession as the admin console, and hence the error.

So to get it to work, I copy the preview link. Close all the browser to ensure the sessions are killed. Open a new browser, paste the preview link and the FormAuthentication works now.

A maybe more convenient solution would be to create a mobile web environment and use that for preview testing.

In WAS and WAS Liberty profile, security integration is enabled by default. This also means that:

... session management facility associates the identity of users with their HTTP sessions. This feature will mark a session as "owned" by the first user that accesses a session that is not already marked as owned.

If a session is already marked as owned, it will check that the owner is the same as the current user. If not, rather than granting access to the session, at minimum a message with identifier SESN0008E will be logged and access to the session will not be granted.

In some cases, an UnauthorizedSessionRequestException is thrown, with message SESN0008E as the cause.

In the MobileFirst Development Server in Eclipse, the underlying WAS Liberty's server.xml has this disabled.

For your POC as a workaround, you can disable the feature by adding in the server.xml file the following entry: <httpSession securityIntegrationEnabled="false"/>

Note that adding this setting is global to all applications and can impact negatively on existing applications on the server, if in existance.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!