////

Variables:

starter-appname: the name of the module users should start with to complete the exercise
starter-config-type: the type of configuration the starter sample uses: javaconfig, xml, boot
completed-appname: the name of the module that contains the completed application
completed-config-type: the type of configuration the completed sample uses: javaconfig, xml, boot
download-url: the URL to download the Spring Security distribution

////

== Setting up the sample

This section outlines how to setup a workspace within https://spring.io/tools/sts[Spring Tool Suite (STS)] so that you can follow along with this guide. The next section outlines generic steps for how to apply Spring Security to your existing application. While you could simply apply the steps to your existing application, we encourage you to follow along with this guide in order to reduce the complexity.

=== Obtaining the sample project

Extract the {download-url}[Spring Security Distribution] to a known location and remember it as _SPRING_SECURITY_HOME_.

=== Import the {starter-appname} sample application

In order to follow along, we encourage you to import the {starter-appname} sample application into your IDE. You may use any IDE you prefer, but the instructions in this guide will assume you are using Spring Tool Suite (STS).

TIP: The completed sample application can be found at _SPRING_SECURITY_HOME_/samples/{completed-config-type}/{completed-appname}

* If you do not have STS installed, download STS from https://spring.io/tools
* Start STS and import the sample application into STS using the following steps:
** *File->Import*
** *Existing Maven Projects*
** Click *Next >*
** Click *Browse...*
** Navigate to the samples (i.e. _SPRING_SECURITY_HOME_/samples/{starter-config-type}/{starter-appname}) and click *OK*
** Click *Finish*

=== Running the {starter-appname} application

In the following exercise we will be modifying the _spring-security-samples-{starter-config-type}-{starter-appname}_  application. Before we make any changes, it is best to verify that the sample works properly. Perform the following steps to ensure that _spring-security-samples-{starter-config-type}-{starter-appname}_  works.

* Right click on the _spring-security-samples-{starter-config-type}-{starter-appname}_ application
* Select *Run As->Spring Boot App*
