Calling Logout from other Systems, how to do it?

Moderator: crythias

Post Reply
rafaqf
OTRS newbie
Posts: 80
Joined: 30 Mar 2011, 11:10
OTRS Version?: 3

Calling Logout from other Systems, how to do it?

Post by rafaqf »

Hi all there,

I have OTRS inside an iFrame portlet into Liferay, and our customer needs to logout from OTRS and other system we use when the user logs out from Liferay.

I tried it in several ways, first of them just to create a Http connection with the normal logout URL like this:

Code: Select all

http://Server_ip/otrs/index.pl?Action=Logout
but we realized that the SessionId was still there in the cookies so that we could log in again without username and password.

Then I tried it directly with javascript with xmlhttprequest so that we could have the cookie with the session, but many cross-site errors were given trying that.

All of that was made without my knowledge about the SysConfig -> Session in OTRS configuration, but after trying again the different methods modyfing the OTRS config, I was not able to achieve the goal.

Is there a real good way of logging out the users from OTRS by using the Action=Logout URL from another system, or with Javascript? Is there a combination of the OTRS configuration that allows us to really logout the users without using the logout button directly?

Any help will be really really appreciated.

Thanks a lot in advance.

Rafa
OTRS 3.0.11 and KIX4OTRS on Linux

CSL
OTRS expert
Posts: 159
Joined: 11 Nov 2011, 19:27
OTRS Version?: 3.0.11

Re: Calling Logout from other Systems, how to do it?

Post by CSL »

If you change
Framework -> Core::Session - SessionUseCookie

To 'No' then your sessions ID's will be stored directly inside the URL itself instead of using cookies.

If you can get the current URL that they are using to access OTRS, then you should then be able to call the logout command with it, allowing OTRS to remove that session ID from the DB and logging the user out.
Backend: OTRS 3.0.11 RedHat Enterprise Linux 6.2, Apache, MySQL with replication
Frontend: OTRS 3.0.11 RedHat Enterprise Linux 6.2 with SELinux, Apache SSL

rafaqf
OTRS newbie
Posts: 80
Joined: 30 Mar 2011, 11:10
OTRS Version?: 3

[SOLVED] Calling Logout from other Systems, how to do it?

Post by rafaqf »

Hi,

Thanks for your reply!

Finally I did a perl script that Logs out the user, it was not so difficult. We call the script from Liferay through a socket in OTRS File System, passing the User as a parameter, then we look the session Id of that User in the DB and we remove that session. By now it's working quite good!!

If anyone needs the code, please write it here and I'll post it.
OTRS 3.0.11 and KIX4OTRS on Linux

humanoid
OTRS newbie
Posts: 1
Joined: 16 Jul 2014, 11:48
OTRS Version?: 3.2.16

Re: Calling Logout from other Systems, how to do it?

Post by humanoid »

Hi,
I am also trying to logout of otrs when i logout of another application. Any suggestions how i can solve this?

rafaqf
OTRS newbie
Posts: 80
Joined: 30 Mar 2011, 11:10
OTRS Version?: 3

Re: Calling Logout from other Systems, how to do it?

Post by rafaqf »

humanoid wrote:Hi,
I am also trying to logout of otrs when i logout of another application. Any suggestions how i can solve this?
Hi,

Unfortunately I'm not working in that company anymore, and I don't have access to that code. But I remember I could do it by coding a little pearl script, to do that stuff said above, and call that perl script with a command line from the socket. When liferay wanted to close the session, the socket throws some command calls to the linux server where OTRS is installed, one of them that to logout the user following that steps with session, cookies and DB. You need to remove the session from the DB, but maybe the other suggestion of changing config also works for you.

Maybe if you open a new post with your question somebody can help you!

Good luck!
OTRS 3.0.11 and KIX4OTRS on Linux

Post Reply