Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSF Login Solution

 
Luciano A. Pozzo
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's the best approach to authentication and authorization of the users on JSF?

I'm using Struts, so I cannot find the solution, because I was used to set the login object on the session and verify on Action... and with JSF I can't!

 
Sergey Smirnov
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do the same with phaseListener. Register your phaseListener and check the login information on the Before Render Response phase. If the session bean that holds the user information is not initialized, redirect the page flow to the login page.

If you still miss the Struts way to go, it is an article about it:
http://blog.exadel.com/?p=19

--
Sergey : http://jsfTutorials.net
[ February 24, 2006: Message edited by: Sergey Smirnov ]
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18226
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alternatively, you can use container-based authentication and define a login form in your web.xml.

The downside to this in JSF is that you can't set up lots of clever URL-based security rules, since JSF doesn't have as many distinct URLs as systems like Struts do.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic