You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ilja <im...@hotmail.com> on 2003/10/06 14:30:42 UTC

Struts and user-authentication

Is there any good example on how to incorporate strict
user-authentication with Struts?

Currently I'm working on a way to implement user-authentication with
OSUser (www.opensymphony.com/osuser) and hibernate (www.hibernate.org)

What's the best way to implement user-security? Where should the
authentication method be put in? In every action? Is it possible to
create one generic class that authorizes a user and sends it to the
appropiate page (either the page he requested, an error or a login-page)
without coding it on every single action page?

Thanks,

Ilja

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: Struts and user-authentication

Posted by Sean Dockery <us...@sbdconsultants.com>.
You can use tiles to optionally display information based on a user's role.
Another possibility is to use the Struts logic tags to test if the user is
in a given role; the body of the tag will either be rendered or
not--depending on whether or not a use is in a given role.

"Ilja" <im...@hotmail.com> wrote in message
news:20031006153624.CF70D76B21@smtp.us2.messagingengine.com...
> Thanks! Very helpfull, but still some questions:
>
> How can you programmaticly make use of struts-config.xml? Now the
> loginpage is hardcoded:
>
> String loginPage = request.getContextPath()+"/logon.do";
>
> Can't you make it more generic so that it uses the config-file to look it
> up?
>
> Secondly: How can you display userinformation in a jsp-page when you have
> your own authentication-system? I probably have to write my own taglibs
> right?
>
> Ilja
>
> On Mon, 6 Oct 2003 18:10:56 +0530, "Deepak" <de...@ltp.soft.net> said:
> > Try this :
> > http://www.theserverside.com/resources/article.jsp?l=JAAS
> >
> > ----- Original Message ----- 
> > From: "Ilja" <im...@hotmail.com>
> > To: <st...@jakarta.apache.org>
> > Sent: Monday, October 06, 2003 6:00 PM
> > Subject: Struts and user-authentication
> >
> >
> > > Is there any good example on how to incorporate strict
> > > user-authentication with Struts?
> > >
> > > Currently I'm working on a way to implement user-authentication with
> > > OSUser (www.opensymphony.com/osuser) and hibernate (www.hibernate.org)
> > >
> > > What's the best way to implement user-security? Where should the
> > > authentication method be put in? In every action? Is it possible to
> > > create one generic class that authorizes a user and sends it to the
> > > appropiate page (either the page he requested, an error or a
login-page)
> > > without coding it on every single action page?
> > >
> > > Thanks,
> > >
> > > Ilja
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
> >




---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: Struts and user-authentication

Posted by Ilja <im...@hotmail.com>.
Thanks! Very helpfull, but still some questions:

How can you programmaticly make use of struts-config.xml? Now the
loginpage is hardcoded:

String loginPage = request.getContextPath()+"/logon.do";

Can't you make it more generic so that it uses the config-file to look it
up?

Secondly: How can you display userinformation in a jsp-page when you have
your own authentication-system? I probably have to write my own taglibs
right?

Ilja

On Mon, 6 Oct 2003 18:10:56 +0530, "Deepak" <de...@ltp.soft.net> said:
> Try this :
> http://www.theserverside.com/resources/article.jsp?l=JAAS
> 
> ----- Original Message ----- 
> From: "Ilja" <im...@hotmail.com>
> To: <st...@jakarta.apache.org>
> Sent: Monday, October 06, 2003 6:00 PM
> Subject: Struts and user-authentication
> 
> 
> > Is there any good example on how to incorporate strict
> > user-authentication with Struts?
> > 
> > Currently I'm working on a way to implement user-authentication with
> > OSUser (www.opensymphony.com/osuser) and hibernate (www.hibernate.org)
> > 
> > What's the best way to implement user-security? Where should the
> > authentication method be put in? In every action? Is it possible to
> > create one generic class that authorizes a user and sends it to the
> > appropiate page (either the page he requested, an error or a login-page)
> > without coding it on every single action page?
> > 
> > Thanks,
> > 
> > Ilja
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: Struts and user-authentication

Posted by Carlos Sánchez <ap...@cousas.net>.
For the second you can add a bean to the session object with user
information after successful login and access it in each page

> -----Mensaje original-----
> De: Ilja [mailto:imhehenkamp@hotmail.com] 
> Enviado el: miércoles, 08 de octubre de 2003 19:13
> Para: struts-user@jakarta.apache.org
> Asunto: Re: Struts and user-authentication
> 
> 
> Anyone?
> 
> On Mon, 06 Oct 2003 17:36:24 +0200, "Ilja" <im...@hotmail.com>
> said:
> > Thanks! Very helpfull, but still some questions:
> > 
> > How can you programmaticly make use of struts-config.xml? Now the 
> > loginpage is hardcoded:
> > 
> > String loginPage = request.getContextPath()+"/logon.do";
> > 
> > Can't you make it more generic so that it uses the 
> config-file to look 
> > it up?
> > 
> > Secondly: How can you display userinformation in a jsp-page 
> when you 
> > have your own authentication-system? I probably have to 
> write my own 
> > taglibs right?
> > 
> > Ilja
> > 
> > On Mon, 6 Oct 2003 18:10:56 +0530, "Deepak" <de...@ltp.soft.net> 
> > said:
> > > Try this : 
> http://www.theserverside.com/resources/article.jsp?l=JAAS
> > > 
> > > ----- Original Message -----
> > > From: "Ilja" <im...@hotmail.com>
> > > To: <st...@jakarta.apache.org>
> > > Sent: Monday, October 06, 2003 6:00 PM
> > > Subject: Struts and user-authentication
> > > 
> > > 
> > > > Is there any good example on how to incorporate strict 
> > > > user-authentication with Struts?
> > > > 
> > > > Currently I'm working on a way to implement user-authentication 
> > > > with OSUser (www.opensymphony.com/osuser) and hibernate 
> > > > (www.hibernate.org)
> > > > 
> > > > What's the best way to implement user-security? Where 
> should the 
> > > > authentication method be put in? In every action? Is it 
> possible 
> > > > to create one generic class that authorizes a user and 
> sends it to 
> > > > the appropiate page (either the page he requested, an 
> error or a 
> > > > login-page) without coding it on every single action page?
> > > > 
> > > > Thanks,
> > > > 
> > > > Ilja
> > > > 
> > > > 
> ------------------------------------------------------------------
> > > > ---
> > > > To unsubscribe, e-mail: 
> struts-user-unsubscribe@jakarta.apache.org
> > > > For additional commands, e-mail: 
> struts-user-help@jakarta.apache.org
> > > 
> > > 
> > > 
> --------------------------------------------------------------------
> > > -
> > > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: 
> struts-user-help@jakarta.apache.org
> > > 
> > > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: Struts and user-authentication

Posted by Ilja <im...@hotmail.com>.
Anyone?

On Mon, 06 Oct 2003 17:36:24 +0200, "Ilja" <im...@hotmail.com>
said:
> Thanks! Very helpfull, but still some questions:
> 
> How can you programmaticly make use of struts-config.xml? Now the
> loginpage is hardcoded:
> 
> String loginPage = request.getContextPath()+"/logon.do";
> 
> Can't you make it more generic so that it uses the config-file to look it
> up?
> 
> Secondly: How can you display userinformation in a jsp-page when you have
> your own authentication-system? I probably have to write my own taglibs
> right?
> 
> Ilja
> 
> On Mon, 6 Oct 2003 18:10:56 +0530, "Deepak" <de...@ltp.soft.net> said:
> > Try this :
> > http://www.theserverside.com/resources/article.jsp?l=JAAS
> > 
> > ----- Original Message ----- 
> > From: "Ilja" <im...@hotmail.com>
> > To: <st...@jakarta.apache.org>
> > Sent: Monday, October 06, 2003 6:00 PM
> > Subject: Struts and user-authentication
> > 
> > 
> > > Is there any good example on how to incorporate strict
> > > user-authentication with Struts?
> > > 
> > > Currently I'm working on a way to implement user-authentication with
> > > OSUser (www.opensymphony.com/osuser) and hibernate (www.hibernate.org)
> > > 
> > > What's the best way to implement user-security? Where should the
> > > authentication method be put in? In every action? Is it possible to
> > > create one generic class that authorizes a user and sends it to the
> > > appropiate page (either the page he requested, an error or a login-page)
> > > without coding it on every single action page?
> > > 
> > > Thanks,
> > > 
> > > Ilja
> > > 
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> > 
> > 

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: Struts and user-authentication

Posted by Deepak <de...@ltp.soft.net>.
Try this :
http://www.theserverside.com/resources/article.jsp?l=JAAS

----- Original Message ----- 
From: "Ilja" <im...@hotmail.com>
To: <st...@jakarta.apache.org>
Sent: Monday, October 06, 2003 6:00 PM
Subject: Struts and user-authentication


> Is there any good example on how to incorporate strict
> user-authentication with Struts?
> 
> Currently I'm working on a way to implement user-authentication with
> OSUser (www.opensymphony.com/osuser) and hibernate (www.hibernate.org)
> 
> What's the best way to implement user-security? Where should the
> authentication method be put in? In every action? Is it possible to
> create one generic class that authorizes a user and sends it to the
> appropiate page (either the page he requested, an error or a login-page)
> without coding it on every single action page?
> 
> Thanks,
> 
> Ilja
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org