Obtaining a reference to the current users UserTicket
is simple: It is stored in a ThreadLocal and accessible using the [fleXive] context FxContext
:
UserTicket ticket = FxContext.get().getTicket();
There is also a shortcut version available:
UserTicket ticket = FxContext.getUserTicket();
For more information about the UserTicket and security see the Reference Documentation