Re: JAAS Login using LoginAction...

2003-09-22 Thread Adam Hardy
Hi Keith,
I'm using JAAS with tomcat and it's not incredibly well supported, if at 
all. I'm not sure if it's the same as what you are talking about. I am 
using org.apache.catalina.realm.JAASRealm, configured in my tomcat's 
server.xml.

Since I am using container-managed authentication, there is no need for 
struts to do anything. Struts only ever receives authenticated requests 
since tomcat sorts that out before letting any through.

Adam

On 09/22/2003 05:49 AM Keith Pemberton wrote:
I'm having a bit of trouble trying to login to a Database Realm that I
have setup with JBoss.  What I would like to do is to be able to login
to the JAAS SecurityManager using a LoginAction.  How is the best way to
go about this.  I have tried just doing it by calling the LoginContext
login method after having passed the LoginModule and CallbackHandler. 
Do I need to create a specialized ActionServlet to do this?  What are
all the important things that I should know on how to authenticate users
by using a Struts Action class?  Thanks in advance for your tips!

Keith Pemberton
--
struts 1.1 + tomcat 4.1.27 + java 1.4.2
Linux 2.4.20 RH9
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: JAAS Login using LoginAction...

2003-09-22 Thread Parmar, Dipakkumar
http://www.theserverside.com/resources/article.jsp?l=JAAS


-Original Message-
From: Keith Pemberton [mailto:[EMAIL PROTECTED]
Sent: Sunday, September 21, 2003 11:50 PM
To: [EMAIL PROTECTED]
Subject: JAAS Login using LoginAction...


I'm having a bit of trouble trying to login to a Database Realm that I
have setup with JBoss.  What I would like to do is to be able to login
to the JAAS SecurityManager using a LoginAction.  How is the best way to
go about this.  I have tried just doing it by calling the LoginContext
login method after having passed the LoginModule and CallbackHandler. 
Do I need to create a specialized ActionServlet to do this?  What are
all the important things that I should know on how to authenticate users
by using a Struts Action class?  Thanks in advance for your tips!

Keith Pemberton
-- 
Keith Pemberton [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: JAAS Login using LoginAction...

2003-09-22 Thread Keith Pemberton
I don't think that the things in this article work.  For one thing, they
are using an auth.conf file and now everything for login module
configuration is stored in the login-config.xml file.  Anyway, tried the
ideas from this website using JBoss 3.2.1 and Struts 1.1?

Keith

On Mon, 2003-09-22 at 09:05, Parmar, Dipakkumar wrote:
 http://www.theserverside.com/resources/article.jsp?l=JAAS
 
 
 -Original Message-
 From: Keith Pemberton [mailto:[EMAIL PROTECTED]
 Sent: Sunday, September 21, 2003 11:50 PM
 To: [EMAIL PROTECTED]
 Subject: JAAS Login using LoginAction...
 
 
 I'm having a bit of trouble trying to login to a Database Realm that I
 have setup with JBoss.  What I would like to do is to be able to login
 to the JAAS SecurityManager using a LoginAction.  How is the best way to
 go about this.  I have tried just doing it by calling the LoginContext
 login method after having passed the LoginModule and CallbackHandler. 
 Do I need to create a specialized ActionServlet to do this?  What are
 all the important things that I should know on how to authenticate users
 by using a Struts Action class?  Thanks in advance for your tips!
 
 Keith Pemberton
-- 
Keith Pemberton [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JAAS Login using LoginAction...

2003-09-22 Thread Bryce Fischer
 Anyway, tried the
 ideas from this website using JBoss 3.2.1 and Struts 1.1?

There's nothing specific to Struts you need concern yourself with.

The only thing that's struts related is how you get your login
information. I've used one of 2 methods:

1. Used a login.jsp, with username and password. LoginAction and
LoginForm

or

2. No login form. Use Servlet Filter to see if there's a UserView in the
session. If not, redirect to a login screen (see #1 above).

Now, the details are more specific to JBoss than Struts, and is really
beyond the scope of this mailling list.

But.. Here's what I suggest:

LoginContext loginContext = new LoginContext(client-login, (CallbackHandler)handler);

loginContext.login();

Make sure you have client-login defined in your login-config.xml, and
its using the org.jboss.security.ClientLoginModule.

Your application must define the authentication policy that contains
your DatabaseLoginModule.

Contact me offlist if you have any other questions. Or better yet,
visit the JBoss forums.

-- 
Bryce Fischer [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]