Skip to content

Latest commit

 

History

History
98 lines (62 loc) · 3.41 KB

README.md

File metadata and controls

98 lines (62 loc) · 3.41 KB

Introduction

This is an example application of my blog entries that describe how you can integration Spring Social and Spring Security. These blog posts are:

This example application uses

  • Spring Framework 3.2.X
  • Spring Social 1.1.0
  • Spring Security 3.2.0

Prerequisites

This example application has the following software prerequisites:

  • JDK 7
  • Maven 3
  • MySQL 5.6.X
  • Twitter application (Enable the "allow this application to be used to Sign in with Twitter" checkbox)
  • Facebook application (Select "website with Facebook login" when you are asked how your application integrates with FB)

You can create the required applications by following these links:

If you don't know how to create these applications, read the following tutorials:

Running The Example Application

This section describes the steps which are required to run the example application.

Preparations

  • Ensure that you have installed all required software.
  • Ensure that you have created a Facebook and a Twitter application used with this example.
  • Create a MySQL database for the example application.

Configuration

You can configure the application by following these steps:

  1. Configure the database connection. The database connection is configured in the file profiles/dev/config.properties.

    db.driver=com.mysql.jdbc.Driver
    db.url=jdbc:mysql://localhost:3306/socialtwitter
    db.username=socialtwitter
    db.password=password
    
  2. Configure the Facebook application. You can configure your Facebook application by creating a file src/main/resources/social.properties The content of this file looks as follows:

    facebook.app.id=foo
    facebook.app.secret=bar
    
  3. Configure the Twitter application. You can configure your twitter application by adding the following configuration to the file src/main/resources/social.properties:

    twitter.consumer.key=foo
    twitter.consumer.secret=bar
    

Initializing the database

You can initialize the database by running the following command at the command prompt:

mvn resources:resources liquibase:update -P dev -e -X

Running The Application

You can run the application by running the following command at the command prompt:

gradle tomcatRun

If running locally, the webpage is available at http://localhost:8080/spring-social-sign-in

If you want to deploy the application to Tomcat, you have to use Tomcat 7 or newer.

Running Tests

  1. You can run unit tests by running the following command at the command prompt:

    gradle test