LoginModule + LoginContext question

Hello there! I'm using a classical j_security_check security authentication approach. I've created a LoginModule (extends Jboss' UserNamePasswordLoginModule) and so far things have been workin fine. Well now I need to have a more complex control, so I decided to not use j_security_check. Instead I'll call a struts action and this one calls my SessionBean how starts the process.

I've read JAAS documentation and it fails in a crucial point, the client view of process. It does not explain how to instantiate a LoginContext's Configuration and how to pass the username/password provided. I mean it's easy through j_security_chek cuz it does everthing for you.

So I'd like to know:

1st. How to set my configuration (changing java policy properties seems to ackward to me, since It's a EAR application and should not be that intrusive)

2nd. How do I set my username/password to be accessible through my Callback interface?

What I've done is:

LoginContext lc =new LoginContext("myLoginModule");// this name is set on my jboss-web.xml as java:/jaas//myLoginModule

lc.Login()

I'm sure I'm doing everthing (or almost) wrong, since this does not work.

Could someone give me some directions?

Thanks and regards

[1373 byte] By [vcarvalhoa] at [2007-10-1 13:05:28]
# 1

Hi..

If you are implementing on an appserver, you would be manipulating the server.policy files instead of the java.policy file directly.

For callback interface.. maybe u've already seen this example but u can basically create a callbackhandler that takes the username/password in the constructor. This way u can pass your callback handler to the logincontext. I maybe stating the obvious to u..

I couldnt gather enough information from ur question to see what ur situation is -- might be able to share some ideas with u.. do elaborate on what u're working on

Regards

RR

rave-Rovera at 2007-7-10 15:48:40 > top of Java-index,Security,Other Security APIs, Tools, and Issues...