JSF with form-based Spring Security
In this section we will implement the form-based authentication with JSF and Spring Security. Integrating Apache MyFaces with Spring Security is not as simple as Struts 2 integration.
It needs a work around. The /j_spring_security
method can't be understood by ApacheMyfaces. The work around is to create a custom login method in our Managed Bean class. We will use the JSF external context class to pass the authentication request to the Spring Security Framework.
Getting ready
Create a new project in you Eclipse IDE:
JSF_Spring_Security_Chapter_3_Recipe2
Do the configurations as shown in the following screenshot
Create a package:
com.packt.jsf.beans
How to do it...
Perform the following steps to integrate JSF with Spring Security to implement form-based authentication:
Create a web project in Eclipse:
Create a Credential Manager Bean:
This bean has all the properties of a form-based authentication bean and customized login method ();
The
j_username
andj_password...