Spring Security with multiple authentication providers
In this section, we will demonstrate multiple authentications with Spring Social and database. In our previous recipe, we used the ConnectController
class which handled the Facebook and Twitter connections. Access to Facebook and Twitter was restricted to the Spring Security URL, that is, only ROLE_EDITOR
had access to Facebook and Twitter. The user had to be authenticated and authorized to use Facebook and Twitter. In this example, we shall allow the users to log in to the application with Facebook and Twitter or normal user ID.
Craig Walls is a lead on Spring Social API and has provided various samples on gitHub, which uses Spring Social with Spring Security. This is one of the samples provided by Craig Walls.
Getting ready
You will need to perform the following tasks:
Create a common page to sign in as a user or sign up using Twitter, Facebook, or linked-in profiles.
Spring Social API has a
ConnectController
class, which automatically...