Spring Security Essentials - Sample Chapter
Spring Security Essentials - Sample Chapter
ee
C o m m u n i t y
Nanda Nachimuthu
P U B L I S H I N G
pl
$ 29.99 US
19.99 UK
Spring Security
Essentials
Sa
m
E x p e r i e n c e
D i s t i l l e d
Spring Security
Essentials
A fast-paced guide for securing your Spring applications
effectively with the Spring Security framework
Nanda Nachimuthu
Preface
Spring Security Essentials focuses on the Spring Security framework. There are three
essential aspects to application security: authentication, authorization, and access
control list (ACL). We will be concentrating on these three aspects in this book.
This book will teach the readers the functionalities required to implement industrystandard authentication and authorization mechanisms to secure enterprise-level
applications using the Spring Security framework. It will help the readers to explore
the Spring Security framework as a Java model and develop advanced techniques,
including custom user realms, custom authorization constraints, method-based
authorization, and instance-based authorization. It will also teach up-to-date use
cases, such as building a security layer for RESTful web services and applications.
Spring Security Essentials focuses on the need to master the security layer, which is
an area that is not often explored by a Spring developer. The IDEs that are used and
the security servers that are involved are briefly explained in the book, including
the steps to install them. Many sample projects are provided in order to help you
practice your newly developed skills. Step-by-step instructions are provided to help
you master the security layer integration with the server, and then implement the
experience gained from this book in your real-time application.
Preface
Chapter 2, Spring Security with SAML, covers the basics of the Spring 4.0 Web MVC
creation and build tools, such as Maven and Gradle, as a recap and practice session.
We create a web-based MVC project and explore the open source implementations of
SAML 2.0 that are available as Identity providers.
You will learn about Spring 4.0 SAML Extensions in order to implement single sign-on
and sign-off by connecting to the SSOCircle web-based authentication mechanism.
Chapter 3, Spring Security with LDAP, covers the basics of LDAP and the different
implementations available. It covers the features of Apache Directory Server and the
steps involved in installing ApacheDS and Studio with Spring Tool Suite. We will
create a directory and the values for different departments and users.
Chapter 4, Spring Security with AOP, explains the basic terminologies of
Aspect-Oriented Programming. We go through a few simple examples of Spring
AOP and AspectJ. The use of annotation is explained using samples and we will
implement AOP security for method-level and UI Component creation. You can
extend the features and implementations that are described in this chapter in your
real-time applications in order to avoid the complexities that are involved in
cross-cutting concerns.
Chapter 5, Spring Security with ACL, introduces the basics of access control lists and
the available classes and interfaces in the Spring ACL package. We will see a few
working examples of the basic ACL implementation with various access privileges
for a given principal.
Chapter 6, Spring Security with JSF, covers the JSF basics and required Spring Security
configurations. We create a sample project from scratch and explain each artifact.
Chapter 7, Spring Security with Apache Wicket, starts with basic the Apache Wicket
application structure and a sample project. We cover the configurations that are
required from the Spring perspective and dependencies required in the Maven POM
file. We make the security credentials settings in the Spring Security file and execute
the sample application by entering different security credentials for different types of
user.
Chapter 8, Integrating Spring Security with SOAP Web Services, covers the basics of the
Spring Web Services package and the different types of SOAP Web service creation.
We execute and test the authentication of the SOAP message as well.
Chapter 9, Building a Security Layer for RESTful Web Services, starts with basics
of RESTful web services and their advantages. We develop a basic Spring
implementation to configure the Security credentials entry points and success
handlers. We also execute RESTful web services through the cURL command-line
utility to check Spring Security authentication in action.
Preface
Chapter 10, Integrating Spring Security with JAAS, covers JAAS basics, Spring JAAS
Security package components and developing a Spring JAAS implementation project
and executing it.
Method-based authorization
Instance-based authorization
Additionally, we will cover specific techniques such as JavaServer Faces (JSF) 2.0,
Wicket, and Java Authentication and Authorization Service (JAAS). The following
are the new security features provided in Spring 4.0, which we will talk about later:
Test support
Secure defaults
Most of these authentication levels are from third parties or developed by relevant
standard bodies such as Internet Engineering Task Force (IETF). Spring Security has
its own authentication features that will be useful to establish connections securely
with third-party request headers, protocols, and single sign-on systems. We will
have a detailed description of each system and mechanism in the following chapters.
[2]
Chapter 1
[3]
[4]
Chapter 1
Apart from these techniques, Spring provides you with options to build
a security layer for RESTful and SOAP web services, and we can create
security layers for JAAS, JSF 2.0, and Wicket. Let's take a quick look at
these four techniques now.
[5]
[6]
Chapter 1
This is called single sign-on implementation using the Spring and SAML integration.
We can also create a common setup to make an enterprise an single sign-on (SSO)enabled one with the following certain standards. This is based on how we set up
Spring and SAML to pass the SAML tokens to the other applications that are using
the SSO. We can create a shared cookie that will contain the authorized SAML token.
Additionally, we can develop an internal SAML token verifier, which may frequently
assess the validity of the token. The securityContext XML file needs to be updated
with the IDP metadata. IDP is nothing but the centralized Identity provider.
Summary
We have seen the various flavors of the Spring Security implementations available
in the Spring Framework 4.0.3 along with the Spring 3.2.3 module. We will explore
each of these options in detail with practical examples in the coming chapters. We
recommend that you have a good understanding of the application development
environment for various technologies that we will address, such as LDAP, SAML,
Wicket, and so on. In the next chapters, we will explain the security implementations
that include the basics of the IDE setup, understanding a sample source code,
building mechanisms, and so on.
[7]
www.PacktPub.com
Stay Connected: