Logout Plugin not being called after direct link navigation
I've created my own login plugin to authenticate users with our system and included a logout extension to logout users in our system upon logging out of nuxeo. This all works fine except when a user follows a direct link to nuxeo e.g. http://mynuxeoinstance/nuxeo/nxpath/default/default-domain/Doc1234@view_documents
If you push logout from that page it navigates to http://mynuxeoinstance/nuxeo/logout instead of calling my logout function.
If you navigate anywhere else from that page in nuxeo, it calls my correct logout function when attempting to logout. Is it related to the ?tabIds=%3A&conversationId=0NXMAIN1 it appends to the url when navigating around? Something about going directly to a page and logging out from there seems to cause it to fail. Any ideas?
Edit: this displays the same issues as this post: http://answers.nuxeo.com/questions/5797/permanent-links-and-cas-authentication
I think I've found the solution to this:
When using a custom Authenticator, sometimes the tomcat session has not been initialized yet (according to this post: http://stackoverflow.com/questions/595872/under-what-conditions-is-a-jsessionid-created). To ensure my session has started I added a
httpRequest.getSession(true);
during the handleRetrieveIdentity method. This seems to fix my issue of Nuxeo going to a page not found after any redirect.
Would you have some code snippet to share? Ideally a (WebDriver) test reproducing the issue?
How does your logout extension work?
To reproduce:<br />
The logout portion of Authenticator:<br /> @Override
<br /><br /> I can watch the logs when you follow my steps to reproduce and it isn't actually calling this logout function when you do that. It's not until you follow a link to a second page in nuxeo that it'll call my handleLogout instead of what I think is the FORM_AUTH logout page?
I don't know if this can help, but we also experiment some troubles with logout link (and also other links in the document page, but not all them) in a page reach by a permanent link with CAS authentication. This happen without any modification of the default behavior. (see http://answers.nuxeo.com/questions/5797/permanent-links-and-cas-authentication)