use: aEvent instanceof InteractiveAuthenticationSuccessEvent
Felipe Nascimento wrote:
>
> tks matt
>
> I have configured HttpSessionEventPublisher in web.xml :
> <listener>
>
> <listener-class>org.acegisecurity.ui.session.HttpSessionEventPublisher</listener-class>
> </listener>
>
>
> I have then created this class to test all this:
>
> public class AcegiAuthenticationListener implements ApplicationListener {
> protected final transient Log log = LogFactory.getLog(getClass());
> public void onApplicationEvent(ApplicationEvent event) {
> if (log.isDebugEnabled()) {
> log.debug("entering AcegiAuthenticationListener. event='"
> + event.getClass() + "'");
> }
> if (event instanceof HttpSessionCreatedEvent) {
>
> }
> }
> }
>
> and configured it in Spring:
> <bean id="acegiAuthListener"
> class="br.com.facio.cityshoes.webapp.listener.AcegiAuthenticationListener"/>
>
>
>
> Then I get the following logs when my application runs and I authenticate:
>
> [cityshoes] DEBUG [main]
> AcegiAuthenticationListener.onApplicationEvent(38) | entering
> AcegiAuthenticationListener. event='class
> org.springframework.context.event.ContextRefreshedEvent'
>
> [cityshoes] WARN [http-8080-Processor25]
> LoggerListener.onApplicationEvent(60) | Authentication event
> AuthenticationSuccessEvent: rony; details:
> [EMAIL PROTECTED]:
> RemoteIpAddress: 127.0.0.1; SessionId:
> EF480DB3AAA68E64A78AD77CF645016E
>
> [cityshoes] WARN [http-8080-Processor25]
> LoggerListener.onApplicationEvent(60) | Authentication event
> InteractiveAuthenticationSuccessEvent: rony; details:
> [EMAIL PROTECTED]:
> RemoteIpAddress: 127.0.0.1; SessionId:
> EF480DB3AAA68E64A78AD77CF645016E
>
> [cityshoes] DEBUG [http-8080-Processor24]
> AcegiAuthenticationListener.onApplicationEvent(38) | entering
> AcegiAuthenticationListener. event='class
> org.springframework.web.context.support.RequestHandledEvent'
>
>
> As you can see, my AcegiAuthenticationListener is not getting nor
> AuthenticationSuccessEvent neither HttpSessionCreatedEvent . Do you
> know why? Is there anything else I have to do to put my
> AcegiAuthenticationListener to listen to AuthenticationSuccessEvent
> and HttpSessionCreatedEvent ?
>
>
> Tks
> Felipe
>
>
>
> 2006/5/15, Matt Raible <[EMAIL PROTECTED]>:
>> You should be able to use the HttpSessionEventPublisher to publish
>> events. Then create your own Listener to listens for these events to
>> be published.
>>
>> http://acegisecurity.org/multiproject/acegi-security/apidocs/org/acegisecurity/ui/session/HttpSessionEventPublisher.html
>>
>> Matt
>>
>> On 5/15/06, Felipe Nascimento <[EMAIL PROTECTED]> wrote:
>> > Hi,
>> >
>> > I have an application that is used by a franchiser an its franchisees.
>> > Begining the franchisee part of the app, I want to put the franchisee
>> > object in the session after the user authenticate (logs in).
>> >
>> > How do you guys suggest I do that? How to interact with acegi so I
>> > execute this logic that will get the Franchisee object from database
>> > and put it in the session? I am not really familiar with acegi.
>> >
>> > I though about putting a filter after acegis filter. Is this the way?
>> >
>> > Tks
>> > Felipe
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > For additional commands, e-mail: [EMAIL PROTECTED]
>> >
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
--
View this message in context:
http://www.nabble.com/add-session-attributes-after-acegi-authentication-tp4394648s2369p16714470.html
Sent from the AppFuse - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]