Fork me on GitHub

Introduction

You can install HST Spring Security Support with example configuration files by either automatically through Essentials or manually by editing some files in your project.

The second section below will describe how to install the module with example configuration files automatically through Essentials, and read the following section and the Configuration page if you want to install it manually.

 

Installing HST Spring Security Support through Essentials

Add essentials plugin to your project

In the essentials pom (essentials/pom.xml), add the following dependency:

    <dependency>
      <groupId>org.onehippo.forge.hst-springsec</groupId>
      <artifactId>hst-springsec-essentials</artifactId>
      <version>${essentials-hippo-security-plugin.version}</version>
    </dependency>
         

 

Find and Install Hippo spring security plugin in Essentials

Now open /essentials/ in your web browser. Find Hippo spring security plugin plugin and install it. It will ask you to rebuild and restart the project. After restarting it, Hippo spring security plugin is already configured.

Essentials also copies all the configuration files explained in the Configuration page to your project.

 

Installing HST Spring Security Support Manually

Add the Forge repository configuration

In the main pom.xml of the project, in the repositories section, add this repository if it is not configured there yet.

    <repository>
      <id>hippo-forge</id>
      <name>Bloomreach Forge maven 2 repository.</name>
      <url>https://maven.onehippo.com/maven2-forge/</url>
    </repository>
        

Add version properties to the project pom

In the main pom.xml of the project, in the properties section, add these properties. For the correct version numbers, check the Release Notes page.

    <spring.security.version>version.number</spring.security.version>
    <forge.hst-springsec.version>version.number</forge.hst-springsec.version>
        

Add Spring Security Dependencies to your project

Add these to the pom.xml of the site module.

    <dependency>
      <groupId>org.springframework.security</groupId>
      <artifactId>spring-security-core</artifactId>
      <version>${spring.security.version}</version>
      <exclusions>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>spring-aop</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>spring-beans</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>spring-context</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>spring-core</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>spring-expression</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>org.springframework.security</groupId>
      <artifactId>spring-security-web</artifactId>
      <version>${spring.security.version}</version>
      <exclusions>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>spring-beans</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>spring-context</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>spring-core</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>spring-expression</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>spring-web</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>org.springframework.security</groupId>
      <artifactId>spring-security-config</artifactId>
      <version>${spring.security.version}</version>
      <exclusions>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>spring-aop</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>spring-beans</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>spring-context</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>spring-core</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>org.springframework.security</groupId>
      <artifactId>spring-security-taglibs</artifactId>
      <version>${spring.security.version}</version>
      <exclusions>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>spring-aop</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>spring-beans</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>spring-context</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>spring-core</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>spring-expression</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>spring-jdbc</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>spring-tx</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>spring-web</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
        

Add HST Spring Security Support Dependencies to your project

Add these to the pom.xml of the site module.

    <dependency>
      <groupId>org.onehippo.forge.hst-springsec</groupId>
      <artifactId>hst-springsec</artifactId>
      <version>${forge.hst-springsec.version}</version>
    </dependency>