/tutorial-spring-ad-security

Very simple Spring 4.x webapp that uses Active Directory for authentication and authorization

Primary LanguageJava

Spring 4.0 Security Example

by Lee Vettleson

Overview

The purpose of this project is to provide an isolated example of a web application using Spring Security. It specifically utilizes an Active Directory service for authentication and role membership.

Dependencies

  1. Spring Framework 4.2.0
  2. Spring Security 4.0.2
  3. SLF4j 1.7.3
  4. Gradle 2.6

Getting Started

To build:

> gradle build

This should build the .war file to deploy to your application container of choice. (Tomcat 8 works)

Then open a browser to the following: http://localhost:8080/SpringSecSample

You will need to log in with your network credentials. As this is not an https connection, please only do this locally. If you deploy to an actual server environment, please change the connection to https and modify the ldap.properties to use the secure connection to Active Directory.

Development environment

I created this using:

This is backwards compatible to Java 1.6 and is easily converted to build with Maven as it originally was a Maven 2+ project that I converted to using Gradle.

Migrating Spring from 3.x to 4.x

Updating from 3 to 4 wasn't too terribly bad but it wasn't a trivial change.

Official Notes are here.