Well, I think the answer to that question, if I understand it correctly, would be up to you . . .
Here, the idea is to use a container plugin for authentication/authorization, but to bypass the container-based form and submittal process, which is kind of inflexible. You would (I assume) be calling isUserInRole, etc., yourself (in Action.execute, for example), and deciding for yourself what to do in either case . . . Erik -----Original Message----- From: Mick Knutson <[EMAIL PROTECTED]> Sent: Aug 8, 2005 8:13 PM To: Struts Users Mailing List <user@struts.apache.org>, [EMAIL PROTECTED] Subject: Re: My first JAAS implementation. Part 2 Where does the user get sent to if they are not in the role? Or is it just an ActionError message? [EMAIL PROTECTED] wrote: > Mark, sorry to not be a ton of help here, but I'm away from some code I have > where I know I did this (meaning, I invoked my LoginModule manually instead > of using container-based auth). I did this with JBoss, not Tomcat, as I > recall. And yes, it does have something to do with writing a CallbackHandler. > That is the guy who gathers credentials at the time of authentication. In > your case, the CallbackHandler implementation would have the username and > password for example as instance fields. When the callback methods are > invoked, your handler simply returns the values of those fields. You set the > values of those fields when you instantiate your CallbackHandler in your > Action code (based on whatever you gathered from your form). This seems > weird, but the callback design makes more sense when you consider that the > username and password might need to be provided right then and there on the > command line in some other type of setup. > > There is a white paper out there on the Web by Scott Stark (JBoss) on JAAS (I > think it is called "JAAS HowTo"). It shows you how to write a > CallbackHandler, how to invoke the LoginModule, etc. I couldn't find it in > the quickest of searches but I still see many mentions of it. I'm not sure > though how much adaptation will be involved if you are doing this with > Tomcat. I remember trying to get help with this on the Tomcat User list, but > got none. At least the source is available if you're really tenacious. > > If you cannot find the paper, I know I have a copy of it on another box. I > could find it and send it to you . . . . I think I have that code lying > around somewhere too (I hope I haven't lied about what I did . . . ). > > Good luck, > > Erik > > -----Original Message----- > From: Mark Benussi <[EMAIL PROTECTED]> > Sent: Aug 8, 2005 6:37 PM > To: 'Struts Users Mailing List' <user@struts.apache.org> > Subject: My first JAAS implementation. Part 2 > > OK. So I got the code working. Great! I can now login using form > authentication and call the all important request.isUserInRole and more > importantly <action roles="role1"> > > > > I now want to ditch this form authentication. It's not what I need as it > doesn't give me enough control over my individual sites. > > > > My simple question is this. > > > > How can I submit a Struts form to a Struts action and then invoke my > LoginModule? Is it something to do with writing a CallbackHandler? > > > > Your help and time is appreciated.. (Hate saying that but it sums it up > nicely). > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] -- Thanks Mick Knutson (925) 951-4126 HP Consulting Services Safeway (Blackhawk Fastword Project) J2EE Architect --- "MMS <safeway.com>" made the following annotations. ------------------------------------------------------------------------------ Warning: All e-mail sent to this address will be received by the Safeway corporate e-mail system, and is subject to archival and review by someone other than the recipient. This e-mail may contain information proprietary to Safeway and is intended only for the use of the intended recipient(s). If the reader of this message is not the intended recipient(s), you are notified that you have received this message in error and that any review, dissemination, distribution or copying of this message is strictly prohibited. If you have received this message in error, please notify the sender immediately. ============================================================================== --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]