• Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB within a LoginModule?

 
Dean Pullen
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to use an EJB within a LoginModule? (JBoss 4)

At the moment the EJB is set to @PermitAll but the LoginModule is re-called when the EJB call is made within itself...
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Assuming it is an unchecked method call it should be OK I think. Have you defined an unauthenticatedIdentity in your application-policy?
 
Dean Pullen
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply..


Yeh it's there:

<module-option name="unauthenticatedIdentity">guest</module-option>


FYI there is no other security annotations within the EJB only, @PermitAll.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A quick step through of an app we have on JBoss4 seems to suggest that regardless whether or not the EJB method permissions are unchecked (or there are no method permissions) the caller must still be an authenticated user, albiet one with no roles. Which means the LoginModule will be called, so it looks like you can't call an ejb method form a LogingModule.
[ February 01, 2008: Message edited by: Paul Sturrock ]
 
Dean Pullen
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's a bit odder than that actually.

After stepping through a bit more carefully...
The EJB is successfully accessed in:
getUsersPassword()

Then LoginModule calls commit().
Which calls super.commit() - which calls getRoleSets() - which on an EJB call inside the getRoleSets() goes back to getUsersPassword() which then loops on itself, over and over, and then finally fails.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmm. Odd. You might ask the guys in the JBoss forum, perhaps they can shed some light?

I did find this in my bookmarks. It might be some help.
 
Dean Pullen
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeh it is, because one call is definitely successful.

I've seen that link and also posted on the jboss forums - neither have been of any use, thanks anyway...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!