Search code examples
plonelogoutplone-4.x

Is there some logout hook in Plone 4?


I have a Plone-4.3-based site which provides access to another site as well: Whenever someone logs in to my site, (s)he can click on special hyperlinks and proceed to that other site without the need to enter a password there (some kind of simple SSO, based on a ReST interface).

Now I have the need to logout the user from that other site whenever (s)he logs out from my own site, e.g. by sending a special request which is of course not the topic of this question (perhaps it still needs to be implemented, because session expiration used to be good enough.)

How would I accomplish this, to be precise: Where would I hook in that secondary logout code? Is there some kind of logout hook, or should I modify some logout.[c]py view? I couldn't find no event nor category mentioned in the Event types section here.


Solution

  • There is the Products.PlonePAS.events.UserLoggedOutEvent for such purposes.

    As an example, it is explained at the Events Section of the Plone Addon Developer Guide