not by spec, we have a lazy realm supporting cdi in tomee btw
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau



2014-03-13 17:46 GMT+01:00 John D. Ament <[email protected]>:
> 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 <
> [email protected]> 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
>>

Reply via email to