Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Spring Security - Third Edition

You're reading from  Spring Security - Third Edition

Product type Book
Published in Nov 2017
Publisher Packt
ISBN-13 9781787129511
Pages 542 pages
Edition 3rd Edition
Languages
Authors (3):
Mick Knutson Mick Knutson
Profile icon Mick Knutson
Peter Mularien Peter Mularien
Profile icon Peter Mularien
ROBERT WILLIAM WINCH ROBERT WILLIAM WINCH
View More author details

Table of Contents (19) Chapters

Preface 1. Anatomy of an Unsafe Application 2. Getting Started with Spring Security 3. Custom Authentication 4. JDBC-Based Authentication 5. Authentication with Spring Data 6. LDAP Directory Services 7. Remember-Me Services 8. Client Certificate Authentication with TLS 9. Opening up to OAuth 2 10. Single Sign-On with the Central Authentication Service 11. Fine-Grained Access Control 12. Access Control Lists 13. Custom Authorization 14. Session Management 15. Additional Spring Security Features 16. Migration to Spring Security 4.2 17. Microservice Security with OAuth 2 and JSON Web Tokens 18. Additional Reference Material

Dynamically defining access control to URLs

Spring Security provides several methods for mapping ConfigAttribute objects to a resource. For example, the antMatchers() method ensures it is simple for developers to restrict access to specific HTTP requests in their web application. Behind the scenes, an implementation of o.s.s.acess.SecurityMetadataSource is populated with these mappings and queried to determine what is required in order to be authorized to make any given HTTP request.

While the antMatchers() method is very simple, there may be times that it would be desirable to provide a custom mechanism for determining the URL mappings. An example of this might be if an application needs to be able to dynamically provide the access control rules. Let's demonstrate what it would take to move our URL authorization configuration into a database.

...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}