[[servlet-authentication-basic]]
= Basic Authentication

This section provides details on how Spring Security provides support for https://tools.ietf.org/html/rfc7617[Basic HTTP Authentication] for servlet based applications.
// FIXME: describe authenticationentrypoint, authenticationfailurehandler, authenticationsuccesshandler

Spring Security's HTTP Basic Authentication support in is enabled by default.
However, as soon as any servlet based configuration is provided, HTTP Basic must be explicitly provided.

A minimal, explicit configuration can be found below:

.Explicit HTTP Basic Configuration
====
[source,java,role="primary"]
.Java
----
protected void configure(HttpSecurity http) {
	http
		// ...
		.httpBasic(withDefaults());
}
----

[source,xml,role="secondary"]
.XML
----
<http>
	<!-- ... -->
	<http-basic />
</http>
----

[source,kotlin,role="secondary"]
.Kotlin
----
fun configure(http: HttpSecurity) {
	http {
		// ...
		httpBasic { }
	}
}
----
====
