[[servlet-authentication]]
= Authentication

Spring Security provides comprehensive support for <<authentication>>.
This section discusses:

[[servlet-authentication-architecture]]
*Architecture Components*

This section describes the main architectural components of Spring Security's used in Servlet authentication.
If you need concrete flows that explain how these pieces fit together, look in specific sections.
// FIXME: add for example see form login if you want to see more concrete flows.

* <<servlet-authentication-securitycontextholder>> - The `SecurityContextHolder` is where Spring Security stores the details of who is <<authentication,authenticated>>.
* <<servlet-authentication-securitycontext>> - is obtained from the `SecurityContextHolder` and contains the `Authentication` of the currently authenticated user.
* <<servlet-authentication-authentication>> - Can be the input to `AuthenticationManager` to provide the credentials a user has provided to authenticate or the current user from the `SecurityContext`.
* <<servlet-authentication-granted-authority>> - An authority that is granted to the principal on the `Authentication` (i.e. roles, scopes, etc.)
* <<servlet-authentication-authenticationentrypoint>> - used for requesting credentials from a client (i.e. redirecting to a log in page, sending a `WWW-Authenticate` response, etc.)
* <<servlet-authentication-abstractprocessingfilter>> - a base `Filter` used for authentication.
This also gives a good idea of the high level flow of authentication and how pieces work together.
* <<servlet-authentication-authenticationmanager>> -  the API that defines how Spring Security's Filters perform  <<authentication,authentication>>.
* <<servlet-authentication-providermanager>> -  the most common implementation of `AuthenticationManager`.

[[servlet-authentication-mechanisms]]
*Authentication Mechanisms*

// FIXME: brief description

* <<servlet-authentication-unpwd>> - how to authenticate with a username/password
// FIXME: Add other mechanisms

// We intentionally do not increase leveloffset, this is just for organization vs document structure
include::architecture/index.adoc[]

include::unpwd/index.adoc[leveloffset=+1]

include::authentication-provider.adoc[]

include::authentication-manager.adoc[]

include::session-management.adoc[]

include::rememberme.adoc[]

include::openid.adoc[]

include::anonymous.adoc[]

include::preauth.adoc[]

include::jaas.adoc[]

include::cas.adoc[]

include::x509.adoc[]

include::runas.adoc[]

include::logout.adoc[]

include::authentication-entry-point.adoc[]
