tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John D. Ament" <john.d.am...@gmail.com>
Subject Re: EJB in custom JAAS LoginModule
Date Thu, 13 Mar 2014 16:46:08 GMT
Hmmm.. I don't know if the JAAS spec or EE specs either state that you can
inject into login modules.


On Thu, Mar 13, 2014 at 12:42 PM, Piercarlo Alberto Beghetto - Diennea <
piercarlo.beghetto@diennea.com> wrote:

>  I still have problem in integration with LoginModule and EJBs.
>
>
>
> What i've done is this:
>
>
>
> *1.       *Created a class implementing LoginModule with inside the
> reference of my @Stateless EJB
>
> The JAAS customization works fine, i can simply access the LoginModule's
> methods, but my EJB is not initialized.
>
>
>
> public class JAASLoginModule implements LoginModule {
>
>
>
>                 @EJB
>
> private UserService userService;
>
>
>
> /* method implementation ...*/
>
> }
>
>
>
> *2.       *Defined the handler to catch the login
>
>
>
> public class JAASCallbackHandler implements CallbackHandler {
>
> @Override
>
> public void handle(Callback[] callbacks) throws IOException,
> UnsupportedCallbackException {
>
>                 /* implementations */
>
> }
>
> }
>
>
>
> *3.       *Defined some custom Principals to match with my "logic" roles
> (i'd like to load roles from DB for each user)
>
>
>
>
>
> Am i missing something? Or it is simply a wrong approach?
>
>
>
> *Piercarlo Alberto Beghetto*
> Developer @ Diennea - MagNews
> Tel.: (+39) 0546 667432 - Int. 967
> Viale G.Marconi 30/14 - 48018 Faenza (RA)
>
> [image: Magnews.it] <http://www.magnews.it/it>
>
> [image: Linkedin] <http://www.linkedin.com/company/diennea---magnews>     [image:
> Twitter] <http://twitter.com/DienneaMagNews>     [image: Facebook]<http://www.facebook.com/pages/MagNews/197617841797>
>      [image: Newsletter]<http://www.magnews.it/it/iscriviti-alla-newsletter>
>
>
>
> ------------------------------
> Rimani aggiornato sul mondo dell'email marketing e del digital marketing:
> visita il nostro blog! http://blog.magnews.it
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message