TechBooky AI Assistant
TechBooky AI Assistant
👋 Welcome to TechBooky AI Assistant

I can help with:
🔎 Tech News
🤖 AI Topics
💻 Gadgets
☁️ Cloud
✍️ Guest Posts
📢 Advertising
🔗 Backlinks
📩 Newsletter
  • AI Search
  • Cryptocurrency
  • Earnings
  • Enterprise
  • About TechBooky
  • Submit Article
  • Advertise With TechBooky
  • Contact Us
TechBooky
  • African
  • AI
  • Metaverse
  • Gadgets
Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Search in posts
Search in pages
  • African
  • AI
  • Metaverse
  • Gadgets
Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Search in posts
Search in pages
TechBooky
Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Search in posts
Search in pages
Home Programming

Understanding The Spring Security Architecture

Contributor by Contributor
September 23, 2019
in Programming
Share on FacebookShare on Twitter
Share this story

Send it to someone who should read it.

f Facebook X X in LinkedIn wa WhatsApp tg Telegram @ Email

In Brief
  • Developed since Ben Alex and team in 2003, Spring Security is a framework that helps provide authorization and authentication to Java applications.
  • With 3.9k stars and 3.3k for Github, its popularity is amply self-explanatory.
  • However, before you dive deep into the intricacies of Spring Security framework, you need to understand the basics of the same.

Developed since Ben Alex and team in 2003, Spring Security is a framework that helps provide authorization and authentication to Java applications. The official release date of stable Spring Security was April 2008. With 3.9k stars and 3.3k for Github, its popularity is amply self-explanatory.

However, before you dive deep into the intricacies of Spring Security framework, you need to understand the basics of the same. Since the main job of Spring Security is to secure web applications that is what we’re going to focus on throughout this article. Also, we assume you are aware of Spring Boot before jumping to Spring Security as it provides for a default stage to work with. Nevertheless, all principles discussed herein will apply to applications not built using Spring Boot as well.

 

Runtime Environment for Spring Security

As per the existing Spring Security architecture, Java 5.0 or higher is needed to run Spring Security successfully. The great part about this is that one need not include any special files in their Java Runtime Environments. Spring is a very self-contained framework and hence you need not put the Spring Security folders in any specific classpath locations. While this sounds super cool, how does the fact that all your files will be contained in the application itself (EJB) sound? That’s right, while running an EJB container you need not conjure up special files or configuration files in a server classloader.

Copy your JAR, WAR, EAR directly from one computer to another and it will work perfectly fine, thanks to the incredible architecture of Spring Security.

 

Building Blocks of Spring Security

Spring Security is mainly built upon:

  • SecurityContextHolder, an object that uses ThreadLocal to store the security context of a process. It provides access to SecurityContext.
  • SecurityContext which holds the object Authentication. It requests for the metadata and security information of the object.
  • Authentication represents the principle requesting for access.
  • GrantedAuthority which holds information regarding what permission is granted to whom throughout the application.
  • UserDetails which holds information to build up Authentication.
  • Pass a String to it and it will make a UserDetail which will, in turn, help generate an Authentication object.

 

Authentication and Authorization

A basic application security problem is primarily about who has the access to information and what is he allowed to do with it? The latter is the authentication problem while the former refers to the authorization problem. Spring Security is a great tool to separate both these problems and tackle them efficiently. 

Authentication

Also worth reading
GitHub Confirms Hackers Stole Data From About 3,800 Internal Repositories Critical Vulnerability In Microsoft Authenticator Exposes Users To Token Theft KongTuke Hackers Exploits Microsoft Teams To Breach Companies New Linux Zero-Day Flaw ‘Dirty Frag’ With Root Access To All Major Distributions Google Chrome 146 Introduces DBSC to Stop Cookie Theft Attacks Iran-Linked Hackers Are Actively Disrupting US Infrastructure — And It’s Getting Worse

Authentication has one main interface: AuthenticationManager which has just one method: authenticate. It can do three things: return a bool authentication value, throw an exception if there is an invalid value detected, as well as return a null when it encounters ambiguity.

Here’s what a standard authentication scenario looks like:

  • A login screen is displayed asking for username and password.
  • A system in place recognizes successfully if the password for the given username is correct.
  • List of roles and permissions for the user is obtained.
  • A security context is established.
  • The user proceeds towards performing tasks once validated. Then comes the role of access specifiers and the system moves on to the process of authorization.

There are a number of classes, interfaces and instances that make this happen. The main ones are UserPasswordAuthenticationToken, AuthenticationManager, Authentication, and SecurityContextHolder. SecurityContextHolder.getContext().setAuthentication(…​) is the method used for step number four.

Authorization

Sometimes, authorization is also known as access control. The ring leader here is AccessDecisionManager. The method ‘decide’ takes the object requesting access and assesses its metadata and decides whether or not a particular action can be performed by the object. 

This is how a web app authorization process looks like:

  • The user clicks on a link on the home page.
  • Request is sent to the server who realizes the user is requesting for a protected piece of information/resource.
  • The server sends back the message that you must authenticate. This means the server will probably redirect you to a webpage. If your browser authenticates you via cookies, it’s a different story.
  • The browser will send back your authentication information to the server.
  • The server will make sure that your credentials are right. If not, access will be denied.
  • Now, you will be either allowed to access the resource or will be served with a “403: Forbidden” HTTP error code.

Note: The three main classes to carry out the above steps are ExecptionTranslationFilter, AuthenticationEntryPoint, and AuthenitcationManager.

 

Closing Thoughts

Spring Security is a comprehensive framework with a solid architecture that allows you to integrate Servlet APIs. It is a great choice for Java applications. To put it simply for millennials who began their careers with Python instead of Java, Spring Security does what Django does for your Python application and more. OAuth2, OpenSSL, Let’s Encrypt, and Auth0 are other frameworks out there in the market attempting to do what Spring Security does.

Companies like Monkey Exchange, Debut, Monbanquet, AfricanStock, ZapLabs, OfferPointer, Mubasher.info, Site, Insoft and so many more make use of Spring Security in their technology Stack. And thanks to its open source status, if you’re getting started with Spring Security you have over twenty thousand answered questions on Stackoverflow waiting to assist you.

 

About author: Professionals of Java Development in India have shared this article to brief you about Understanding the Spring Security Architecture.

Related Reading

More contextual TechBooky stories selected from tags, categories and article context.

  • newFile-4
    Dorsey Says Bitchat Software Lacks Security Review
  • updated_blog_hero_image__1.width-1200.format-webp
    Google TV Adds Gemini Tab, Richer Visuals and Sports Briefs
  • skynews-google-chrome-logo_6753346
    Google Chrome To Debut Support for ARM64 Linux This Spring
  • zwZByeKjWvA4Lpia2d5wee-1200-80
    Apple's AI Strategy Faces Investor Scepticism as…
  • OpenClaw moltbot AI assistant
    OpenClaw’s Viral Rise Exposes Security Risks in Agentic AI
  • apple-and-google-featured-image
    Apple Intelligence and Google Gemini Integration Is…
  • Realistic-and-stylized-avatars-in-Zoom-Meetings
    Zoom Unveils AI Office Suite With Avatars Arriving…
  • android
    Google Patches 107 Flaws Including 2 Android Zero-Days
Keep Reading Smarter

Search TechBooky with AI

Use TechBooky's AI Search to explore the context behind this story and related coverage across the site.

Try AI Search
More On This Topic
Programming
Follow TechBooky

Follow TechBooky for more technology stories and newsroom updates.

f Facebook X X in LinkedIn ig Instagram wa WhatsApp

Tags: AuthenticationjavaprogrammingsecuritySpring SecuritySpring Security Architecturetech tips
Contributor

Contributor

Posts by contributors. You can send in a post to be reviewed and published to info@techbooky.com

Search TechBooky
Open TechBooky AI Search Try the AI Assistant

BROWSE BY CATEGORIES

Receive top tech news directly in your inbox

subscription from
Loading

Freshly Squeezed

  • Runware Says Portable AI Pods Can Ease Compute Crunch August 4, 2026
  • Nigeria Project BRIDGE Puts Fibre At Centre Of Digital Economy August 4, 2026
  • Apple Expands OpenAI Trade-Secret Fight In Court August 4, 2026
  • Spotify Turns 300M Premium Users Into An AI Music Bet August 4, 2026
  • Zenith Bank Warns Customers After Limited Data Access August 4, 2026
  • Ad-Tech Data Is Becoming A Cybersecurity Weapon August 4, 2026
  • Cote d’Ivoire Backs 30 Startups In Digital Push August 4, 2026
  • Deep Learning Indaba Tackles Africas Code-Switching Gap August 4, 2026
  • OpenAI Fires Back At Apple In AI Hardware Lawsuit August 4, 2026
  • Snap Revenue Rises As Snapchat Moves Beyond Ads Alone August 4, 2026
  • Palantir Revenue Surges 93% As AI Software Demand Keeps Defying Doubters August 4, 2026
  • Horizon3 Raises $250M As AI Pentesting Gets Hot August 3, 2026

Browse Archives

August 2026
M T W T F S S
 12
3456789
10111213141516
17181920212223
24252627282930
31  
« Jul    

Quick Links

  • About TechBooky
  • Advertise With TechBooky
  • Contact us
  • Submit Article
  • Privacy Policy
Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Search in posts
Search in pages
  • African
  • Artificial Intelligence
  • Gadgets
  • Metaverse
  • Tips
  • AI Search
  • About TechBooky
  • Advertise With TechBooky
  • Submit Article
  • Contact us

© 2025 Designed By TechBooky Elite

Discover more from TechBooky

Subscribe now to keep reading and get access to the full archive.

Continue reading

We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.