> For the complete documentation index, see [llms.txt](https://www.pranaypourkar.co.in/the-programmers-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.pranaypourkar.co.in/the-programmers-guide/spring/spring-features/spring-security/authentication/core-components.md).

# Core Components

## About

Spring Security authentication consists of several key components that work together to authenticate users and manage security contexts. Below are the core components -

<table data-full-width="false"><thead><tr><th width="222">Component</th><th>Description</th></tr></thead><tbody><tr><td><strong>Security Filter Chain</strong></td><td>Handles security filters like authentication and authorization.</td></tr><tr><td><strong>AuthenticationManager</strong></td><td>Central component for handling authentication.</td></tr><tr><td><strong>AuthenticationProvider</strong></td><td>Validates authentication requests.</td></tr><tr><td><strong>UserDetailsService</strong></td><td>Loads user information from the database.</td></tr><tr><td><strong>UserDetails</strong></td><td>Represents authenticated user details.</td></tr><tr><td><strong>PasswordEncoder</strong></td><td>Hashes and validates passwords.</td></tr><tr><td><strong>SecurityContextHolder</strong></td><td>Stores authentication details of the current user.</td></tr><tr><td><strong>GrantedAuthority</strong></td><td>Represents roles and permissions.</td></tr><tr><td><strong>Authentication Token</strong></td><td>Stores authentication requests or responses.</td></tr><tr><td><strong>Security Configuration</strong></td><td>Defines security rules and authentication mechanisms.</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.pranaypourkar.co.in/the-programmers-guide/spring/spring-features/spring-security/authentication/core-components.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
