Hi!

I've simple ejb/struts web servis. I use DatabaseServerLoginModule as login-module. 
Users enters their email/password through custom html form. Response goes to struts 
action (not to j_security_check). This action look like this:

anonymous wrote : String email = (String) context.getFormProperty("email");
  | String password = (String) context.getFormProperty("password");
  | 
  | SecurityAssociationHandler handler = new SecurityAssociationHandler();
  | Principal principal = new SimplePrincipal(email);
  | handler.setSecurityInfo(principal, password.toCharArray());
  | LoginContext login =  new LoginContext("jdn", handler);
  | login.login();
  | Subject subject = login.getSubject();
  | 
  | SecurityAssociation.setPrincipal(user);
  | SecurityAssociation.setCredential(userpassword.toCharArray());
  | SecurityAssociation.setSubject(subject);

After this I can access user's principal from any ejb [e.g 
sessionContext.getCallerPrincipal() ] but httpServletRequest.getUserPrincipal() always 
returns null!

I've read jaas how-to and posts from this news group but I can't find any solution for 
this problem.

I'll be very thankful for any help, tips becouse I've wasted whole three days on it 
without any success.

Artur Wronski

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3836227#3836227

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3836227



-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to