Using JSF with digest/hashing-based Spring Security
In this section we will implement digest authentication with JSF and Spring Security. The user's password is hashed using one of the encryption algorithms and configured in the .xml
file. The algorithm used to hash the password is also mentioned in the configuration file.
Getting ready
Spring digest authentication works fine with JSF as well. We need to hash the password using jacksum.jar
. Provide the hashed password in the configuration file. Also mention the algorithm used for hashing in the configuration file.
How to do it...
Perform the following steps for implementing the digest authentication mechanism with JSF and Spring Security:
- Let's encrypt the password:
packt123456
. - We need to use an external jar, Jacksum, which means Java checksum.
- It supports both MD5 and SHA1 encryption.
- Download the
jacksum.zip
file and extract the ZIP folder.packt>java -jar jacksum.jar -a sha -q"txt:packt123456"
- Let's create a new project...