Le mar. 8 mai 2018 10:50, Matthew Broadhead <[email protected]>
a écrit :

> @WebListener works fine
>
> public void processSessionScopedInit(@Observes
> @Initialized(SessionScoped.class) HttpSession payload) {} caused an
> infinite loop in the code.  i can send you a stack trace but it grows so
> long it is hard to find the initial cause
>


Put a breakpoint ;)

>
> however i have not fixed my problem because
> KeycloakPrincipal<KeycloakSecurityContext> is not available at session
> start.  The session starts before the redirect to the login page.
>
> is there any way to execute code just after a user signs in?  i am just
> trying to log username and ip for security purposes
>

Depends your login mecanism, maybe have a look on keycloak side



>
> On 07/05/18 18:18, Romain Manni-Bucau wrote:
> > @WebListener on a HttpSessionListener?
> >
> > otherwise @Observes @Initialiazed(SessionScoped.class) in the cdi bean
> >
> >
> > Romain Manni-Bucau
> > @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> > <https://rmannibucau.metawerx.net/> | Old Blog
> > <http://rmannibucau.wordpress.com> | Github <
> https://github.com/rmannibucau> |
> > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> > <
> https://www.packtpub.com/application-development/java-ee-8-high-performance
> >
> >
> > 2018-05-07 17:10 GMT+02:00 Matthew Broadhead <
> [email protected]
> >> :
> >> what is the best way to run code when a session is first created?  i
> >> thought maybe a @PostConstruct inside a @Named @SessionScoped but it
> >> doesn't trigger.
> >>
>
>

Reply via email to