• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

FORMS authentication

 
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a webapp running in a Servlet 2.4 container (Tomcat 5.0.27).
This webapp uses FORMS authentication.
The webapp also allows a user to 'create an account' by supplying their preferred username and password.

The problem is that I do not want to require the user to reauthenticate using the form after 'creating an account'. That is to say, I have a username, a password and an unauthenticated user. Is it possible to authenticate this user automatically in a container-standard manner?

I have had various ideas:
- using a RequestDispatcher to forward the request to "j_security_check".
This would require me to set the javax.servlet.forward.request_uri request attribute - but this sounds 'hacky'.
- Manually perform the same actions that a FORMS login performs (set a session attribute? I can't find anything 'concrete' in the specification)

I figure that this problem has occurred before, so I'm looking for a robust solution - advice is appreciated.
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Unfortunately it looks like this feature was missed fomr the spec, it is often available but is container specific. WebSphere uses a class called the SSOAuthenticator, and I wasn't able to find a way to do it in Tomcat last time I looked, but that was several versions ago.

Hope this helps in some small way.
Dave
 
Tony Morris
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply.
For anyone interested, I seem to have found a container-independant solution: http://sourceforge.net/projects/securityfilter/
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic