Spring Security with Spring Social to access Twitter
We just now connected with Facebook and were able to post messages. In this section, we will see how to connect to Twitter. Let's use the same application that we used for Facebook with derby database and hibernate the authentication service.
Getting ready
You will need to perform the following tasks to access Twitter with Spring Social using Spring Security:
Create a Twitter app: https://dev.twitter.com/apps/new
Add the consumer ID and key to the
.properties
file.Update the controller to handle Twitter requests
Create JSP files to access and display Twitter objects
How to do it...
The following is the step for implementing Twitter sign-in options in the application demonstrated in the previous section:
Update the controller named
HorrorMovie Controller
to handle Twitter requests.< @RequestMapping(value = "/posttofb", method = RequestMethod.GET) public String posttofb(String message, ModelMap model) { try { Facebook facebook =...