Book Image

Spring Security 3.1

By : Robert Winch, Peter Mularien
Book Image

Spring Security 3.1

By: Robert Winch, Peter Mularien

Overview of this book

<p>Knowing that experienced hackers are itching to test your skills makes security one of the most difficult and high-pressure concerns of creating an application. The complexity of properly securing an application is compounded when you must also integrate this factor with existing code, new technologies, and other frameworks. Use this book to easily secure your Java application with the tried and trusted Spring Security framework, a powerful and highly customizable authentication and access-control framework.<br /><br />"Spring Security 3.1" is an incremental guide that will teach you how to protect your application from malicious users. You will learn how to cleanly integrate Spring Security into your application using the latest technologies and frameworks with the help of detailed examples.<br /><br />This book is centred around a security audit of an insecure application and then modifying the sample to resolve the issues found in the audit.<br /><br />The book starts by integrating a variety of authentication mechanisms. It then demonstrates how to properly restrict access to your application. It concludes with tips on integrating with some of the more popular web frameworks. An example of how Spring Security defends against session fixation, moves into concurrency control, and how you can utilize session management for administrative functions is also included.<br /><br />"Spring Security 3.1" will ensure that integrating with Spring Security is seamless from start to finish.</p>
Table of Contents (24 chapters)
Spring Security 3.1
Credits
About the Author
Acknowledgement
About the Reviewers
www.PacktPub.com
Preface
Index

Mapping additional attributes of UserDetails


Finally, once the LDAP lookup has assigned the user a set of GrantedAuthority objects, o.s.s.ldap.userdetails.LdapUserDetailsMapper will consult o.s.s.ldap.userdetails.UserDetailsContextMapper to retrieve any additional details to populate the UserDetails object for application use.

With <ldap-authentication-provider>, we've configured to this point that LdapUserDetailsMapper will be used to populate a UserDetails object with information gleaned from the user's entry in the LDAP directory.

We'll see in a moment how UserDetailsContextMapper can be configured to pull a wealth of information from the standard LDAP person and inetOrgPerson objects. With the baseline LdapUserDetailsMapper, little more than username, password, and GrantedAuthority is stored.

Although there is more machinery involved behind the scenes in LDAP user authentication and detail retrieval, you'll notice that the overall process seems somewhat similar (authenticating the...