Skip navigation
4576 Views 4 Replies Latest reply: Dec 22, 2007 7:09 AM by Daniel Henninger RSS
Guus der Kinderen KeyContributor 777 posts since
Sep 8, 2005
Currently Being Moderated

Apr 4, 2007 12:14 AM

New EventListener to catch ''successful authentication'' events.

Openfire currently offers three types of events:

 

GroupEvents (unrelated to this discussion)

 

SessionEvents:

  • A session was created.

  • A session was destroyed

  • An anonymous session was created.

  • An anonymous session was created.

 

UserEvents:

  • A user was created.

  • A user is being deleted.

  • A user''s name, email, or an extended property was changed.

 

There''s a significant difference in the creation of a new session and a logon (which I define as a successful authentication attempt). I''d like to be able to catch ''authentication events'' as well, as having a trigger that fires after a user successfully logged in can be useful.

 

I can see at least two possible solutions: We can create a new EventListener and -Dispatcher class that handles these events, or we can add methods to one of the existing structures.

 

The first option would create a new class that''s a bit weird, because the ''mirrored'' functionality of authenticate/logon would be the essentially the same as ''session destroyed''. The second option would force all existing implementations of the interface to update, as the new interface-defined methods need to be implemented.

 

The first option, creating a new ''AuthenticateEventListener'', only introduces one slightly weird situation (in logoff/session-destroy situations where a class implements both the SessionEventListener and the new interface). I would prefer this over the other solution - several small interfaces as opposed to a few bigger ones should gives you more flexibility.

 

Opinions and/or suggestions anyone?

  • Gaston Dombiak Jiver 3,863 posts since
    Sep 26, 2001

    Hey Guus,

     

    I updated the javadocs of SessionEventListener to better describe when the events are triggered. Those events are triggered when users authenticate or authenticated session are destroyed. The creation events are not triggered when an entity connects to the server (at that point the server cannot know if the user is going to authenticate as anonymous or not).

     

    However, there is no event for "there is a new c2s connection" in Openfire. Do you think you will need such event?

     

    Thanks,

     

      -- Gato

More Like This

  • Retrieving data ...

Bookmarked By (0)