You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Sudhir S. Shetty" <ss...@powershare.net> on 2002/04/03 14:19:32 UTC

Help needing regarding implementing JAAS for a Web application

Hello Everyone,
                         I need your help regarding Implementing JAAS for a
web app based on Struts, I have made a class which instantiates the Login
context, and has an inner class callback handler(for receiving  the user
name and password).
But I get an error when the login context is instantaiated , that the Config
file cant be found.
Could anyone please send me some code which depicts clearly how JAAS can be
implemented in a Web app (my application server is Weblogic).
I need it urgently as I have a deadline to meet.
Thanks in advance,
regards,
Sudhir


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Help needing regarding implementing JAAS for a Web application

Posted by "Sudhir S. Shetty" <ss...@powershare.net>.
Hi Mike,
               Im deploying the webapp inside WebLogic , I have refered to the WebLogic security docs, I have modified the Weblogic jaas example, So that the call back handler receives a parameter from the class that instantiates the Logincontext(here I have a method which accepts the username and password as a parameter),
when I execute this class from the command line as a standalone, the authentication occurs without any problems.
For my Web Application, instead of supplying the username and password from the command line when i enter it through a JSP (this JSP has 2 entry fields , username and password) , The request is transfered to another JSP where I receive the username and password ,here I supply these as parameters to the method of the Class that instantiates the Logincontext.
Here I get The following error :-

"The userName= system The Password = weblogic
  Invalid Configuration Class Name: com.security.jaas.SecurityConfig "

Cna You guide me on this Im attaching the web application directory with this mail.
It would be really helpful if you can guide me on this.

thanks in advance ,
regards,
Sudhir

PS.- My starting jsp file is login2.jsp.

----- Original Message ----- 
From: "Mike Finn" <mi...@frontiercorp.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Wednesday, April 03, 2002 18:48
Subject: RE: Help needing regarding implementing JAAS for a Web application


> Sudhir,
> Are you deploying your webapp outside of WebLogic? The answer to your
> question really depends on the web container you are using. For example, I
> don't *think* there is any 'production' ready support for a JAAS Realm in
> Tomcat. If you are deploying to the WebLogic web container, then RTFM the
> WebLogic security docs. They are pretty good. JAAS is an integral part of
> J2EE and is provided by the container ( I don't think WL 6.x provides
> *authorization* with their JAAS implementation, however  - only
> authentication ). If you are using/can use container security, there should
> be no need to write your own LoginContext and callback handler, AFAIK. Also,
> if you are using container ("declarative") security, if your security
> requirements are simple enough, you won't have to write ANY code. That's the
> idea behind JAAS being in the J2EE spec.
> 
> BTW - your JAAS config file is located by
> using: -Djava.security.auth.login.config=file://path/to/a/config/file on the
> command line.
> 
> HTH,
> Mike
> 
> 
> -----Original Message-----
> From: Sudhir S. Shetty [mailto:sshetty@powershare.net]
> Sent: Wednesday, April 03, 2002 7:20 AM
> To: Struts Users Mailing List
> Subject: Help needing regarding implementing JAAS for a Web application
> 
> 
> Hello Everyone,
>                          I need your help regarding Implementing JAAS for a
> web app based on Struts, I have made a class which instantiates the Login
> context, and has an inner class callback handler(for receiving  the user
> name and password).
> But I get an error when the login context is instantaiated , that the Config
> file cant be found.
> Could anyone please send me some code which depicts clearly how JAAS can be
> implemented in a Web app (my application server is Weblogic).
> I need it urgently as I have a deadline to meet.
> Thanks in advance,
> regards,
> Sudhir
> 
> 
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 

RE: Help needing regarding implementing JAAS for a Web application

Posted by Mike Finn <mi...@frontiercorp.com>.
Sudhir,
Are you deploying your webapp outside of WebLogic? The answer to your
question really depends on the web container you are using. For example, I
don't *think* there is any 'production' ready support for a JAAS Realm in
Tomcat. If you are deploying to the WebLogic web container, then RTFM the
WebLogic security docs. They are pretty good. JAAS is an integral part of
J2EE and is provided by the container ( I don't think WL 6.x provides
*authorization* with their JAAS implementation, however  - only
authentication ). If you are using/can use container security, there should
be no need to write your own LoginContext and callback handler, AFAIK. Also,
if you are using container ("declarative") security, if your security
requirements are simple enough, you won't have to write ANY code. That's the
idea behind JAAS being in the J2EE spec.

BTW - your JAAS config file is located by
using: -Djava.security.auth.login.config=file://path/to/a/config/file on the
command line.

HTH,
Mike


-----Original Message-----
From: Sudhir S. Shetty [mailto:sshetty@powershare.net]
Sent: Wednesday, April 03, 2002 7:20 AM
To: Struts Users Mailing List
Subject: Help needing regarding implementing JAAS for a Web application


Hello Everyone,
                         I need your help regarding Implementing JAAS for a
web app based on Struts, I have made a class which instantiates the Login
context, and has an inner class callback handler(for receiving  the user
name and password).
But I get an error when the login context is instantaiated , that the Config
file cant be found.
Could anyone please send me some code which depicts clearly how JAAS can be
implemented in a Web app (my application server is Weblogic).
I need it urgently as I have a deadline to meet.
Thanks in advance,
regards,
Sudhir


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>