Im building a few JSF interfaces that im going to embedd into a website. I want though to allow the user to log into the website inorder to view another JSF interface where they can update details about the services the website will offer.
What I want to know is, do I need to implemented a Login/Registration facility from scratch or is there an existing system already out there that I can easily use. The db im using is a derby db and the application runs on a GF server.
Or can someone recommend some good resources on building a custom user site using JSF?
Sorry if this question has been asked before and I missed it in my searches before.
P
All the textbooks seem to mention container-managed security but I have always stayed away from it. In every application I have done so far I have implemented application-managed authentication, which gives you much more flexibility with regard to how authentication is done. The price of course is you will have to allocate a couple of days to implementing and fiddling with it.
The key to making it easy is to 1) incorporate the authentication right in your Facelets template that all pages use so you always have it, and 2) have a @SessionScoped bean which holds the state of the user login. In the application I am working on now the top part of the template looks like this:
I’ll not bore you with the UserSession bean since it should be pretty obvious. The sysUser property is actually a JPA entity fetched from the Derby data base.
(Note the extra h:commandLink value=”A”. That’s a link that automatically logs me in so I don’t have to type my username and password over and over again while developing.)
That should probably be what you need.