Skip to content
This repository has been archived by the owner on Dec 12, 2018. It is now read-only.

Commit

Permalink
updated tutorial and quickstart per @lhazlewood's feedback. Quickstar…
Browse files Browse the repository at this point in the history
…t retains Spring Security while beginngin of tutorial does not. Refined .travis.yml to better detect release so it doesn't publish docs twice. split javadocs creation - one for release builds all javadocs and one for travis builds aggregated javadocs.
  • Loading branch information
dogeared committed Oct 31, 2015
1 parent dac4d48 commit 0a5dd40
Show file tree
Hide file tree
Showing 6 changed files with 108 additions and 61 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ before_install:
-d
- chmod 600 ~/.ssh/id_rsa
- export RELEASE_VERSION="$(mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version|grep -Ev '(^\[|Download\w+:)')"
- export IS_RELEASE="$([ ${RELEASE_VERSION/SNAPSHOT} == $RELEASE_VERSION ] && echo 'true')"
- export IS_RELEASE="$([ ${RELEASE_VERSION/SNAPSHOT} == $RELEASE_VERSION ] && [ $TRAVIS_BRANCH == 'master' ] && echo 'true')"
- export BUILD_DOCS="$([ $TRAVIS_JDK_VERSION == 'oraclejdk8' ] && echo 'true')"
install:
- test -z "$BUILD_DOCS" || pip install --user sphinx
Expand Down
2 changes: 1 addition & 1 deletion build_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ make html
cd ../../../../

# javadocs
mvn javadoc:aggregate -P docs
mvn javadoc:aggregate -P travis-docs
44 changes: 44 additions & 0 deletions extensions/spring/boot/docs/source/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,50 @@ Topics:

.. include:: stormpath-spring-boot-setup.txt

.. _dependency-jar:

Add the Stormpath Default Spring Boot Starter
---------------------------------------------

This step allows you to enable Stormpath in a Spring Boot web app with *very minimal* configuration.
It includes Stormpath Spring Security, Stormpath Spring WebMVC and Stormpath Thymeleaf templates. How amazing is that? Here's how.

Using your favorite dependency resolution build tool like Maven or Gradle, add the stormpath-default-spring-boot-starter-|version|.jar to your project dependencies. For example:

**Maven**:

.. parsed-literal::
<dependency>
<groupId>com.stormpath.spring</groupId>
<artifactId>stormpath-default-spring-boot-starter</artifactId>
<version>\ |version|\ </version>
</dependency>
**Gradle**:

.. parsed-literal::
dependencies {
compile 'com.stormpath.spring:stormpath-default-spring-boot-starter:\ |version|\ '
}
In order to connect Stormpath and Spring Security, we need one small configuration class in your project:

.. code-block:: java
:emphasize-lines: 2
@Configuration
public class SpringSecurityWebAppConfig extends StormpathWebSecurityConfigurerAdapter {}
Without this, you will get a popup in your browser prompting for authentication, which is the default basic authentication for Spring Security.

Also, by default, all paths are locked down with Spring Security. Stormpath's Spring Security integration follows this idiomatic
behavior.

That's it! You're ready to start using Stormpath in your Spring Boot web application! Can you believe how easy that was?

Try it!
-------

Expand Down
43 changes: 0 additions & 43 deletions extensions/spring/boot/docs/source/stormpath-spring-boot-setup.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,49 +31,6 @@ All communication with Stormpath must be authenticated with an API Key.

On Windows, you can `set file permissions similarly`_.

.. _dependency-jar:

Add the Stormpath Default Spring Boot Starter
---------------------------------------------

This step allows you to enable Stormpath in a Spring Boot web app with *very minimal* configuration.
It includes Stormpath Spring Security, Stormpath Spring WebMVC and Stormpath Thymeleaf templates. How amazing is that? Here's how.

Using your favorite dependency resolution build tool like Maven or Gradle, add the stormpath-default-spring-boot-starter-|version|.jar to your project dependencies. For example:

**Maven**:

.. parsed-literal::

<dependency>
<groupId>com.stormpath.spring</groupId>
<artifactId>stormpath-default-spring-boot-starter</artifactId>
<version>\ |version|\ </version>
</dependency>

**Gradle**:

.. parsed-literal::

dependencies {
compile 'com.stormpath.spring:stormpath-default-spring-boot-starter:\ |version|\ '
}

In order to connect Stormpath and Spring Security, we need one small configuration class in your project:

.. code-block:: java
:emphasize-lines: 2

@Configuration
public class SpringSecurityWebAppConfig extends StormpathWebSecurityConfigurerAdapter {}

Without this, you will get a popup in your browser prompting for authentication, which is the default basic authentication for Spring Security.

Also, by default, all paths are locked down with Spring Security. Stormpath's Spring Security integration follows this idiomatic
behavior.

That's it! You're ready to start using Stormpath in your Spring Boot web application! Can you believe how easy that was?

.. _examples: https://github.com/stormpath/stormpath-sdk-java/tree/master/examples
.. _sign up for Stormpath for free: https://api.stormpath.com/register
.. _Stormpath Admin Console: https://api.stormpath.com
Expand Down
43 changes: 27 additions & 16 deletions extensions/spring/boot/docs/source/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,25 +50,30 @@ For a gradle build and run, do this:
You should now be able to browse to `<http://localhost:8080>`_ and see a welcome message with your Stormpath application's name.

This application has just two code files in it. Here's the structure:
This application has just two code files and a properties file in it. Here's the structure:

.. code-block:: bash
:emphasize-lines: 9, 10
.
`-- src
`-- main
`-- java
`-- com
`-- stormpath
`-- tutorial
|-- controller
| `-- HelloController.java
`-- Application.java
``Application.java`` is a most basic Spring Boot application file with a ``main`` method:
`-- main
|-- java
| `-- com
| `-- stormpath
| `-- tutorial
| |-- controller
| | `-- HelloController.java
| `-- Application.java
`-- resources
`-- application.properties
``Application.java`` is a most basic Spring Boot application file with a ``main`` method and the ``@SpringBootApplication``
annotation:
.. code-block:: java
:linenos:
:emphasize-lines: 1
@SpringBootApplication
public class Application {
Expand All @@ -95,14 +100,20 @@ This application has just two code files in it. Here's the structure:
Here we have our first taste of Stormpath in action. On line 5 we are getting hold of the Stormpath application and on
line 6 we are obtaining its name for display.
For this example, we don't want Spring Security locking everything down, which is its default behavior. So, we will simply
disable it. That's where the ``application.properties`` files comes in:
.. code-block:: java
:linenos:
stormpath.spring.security.enabled = false
security.basic.enabled = false
The first line disables Stormpath's hooks into Spring Security and the second line disables Spring Security itself.
Pretty simple setup, right? In the next section, we'll layer in some flow logic based on logged-in state. And then we
will refine that to make use of all the Spring Security has to offer in making our lives easier.
Feeling adventurous? Browse on over to ``http://localhost:8080/login``. You will see the default Stormpath login form.
You can login in as an existing user, register a new user and even reset your password. Where did this come from? It's
all part of the built in authentication flows that Stormpath provides. With a 1-line ``main`` method and
a 2-line controller, you get all this functionality out of the box.

.. _some-access-controls:
Some Access Controls
Expand Down
35 changes: 35 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,41 @@
</profile>
<profile>
<id>docs</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.1</version>
<executions>
<execution>
<id>attach-api-docs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<inherited>true</inherited>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.1.2</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
<inherited>true</inherited>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>travis-docs</id>
<build>
<plugins>
<plugin>
Expand Down

0 comments on commit 0a5dd40

Please sign in to comment.