2019-12-07 00:39:55 +08:00
|
|
|
[[servlet-authentication-unpwd]]
|
|
|
|
= Username/Password Authentication
|
2020-02-29 06:39:41 +08:00
|
|
|
:figures: images/servlet/authentication/unpwd
|
|
|
|
:icondir: images/icons
|
2019-12-07 00:39:55 +08:00
|
|
|
|
|
|
|
One of the most common ways to authenticate a user is by validating a username and password.
|
2020-02-29 01:33:31 +08:00
|
|
|
As such, Spring Security provides comprehensive support for authenticating with a username and password.
|
2019-12-07 00:39:55 +08:00
|
|
|
|
2020-02-29 01:33:31 +08:00
|
|
|
[[servlet-authentication-unpwd-input]]
|
2021-07-27 04:48:55 +08:00
|
|
|
== Reading the Username & Password
|
2020-03-03 01:56:56 +08:00
|
|
|
|
2020-02-29 01:33:31 +08:00
|
|
|
Spring Security provides the following built in mechanisms for reading a username and password from the `HttpServletRequest`:
|
2019-12-07 00:39:55 +08:00
|
|
|
|
2021-07-31 05:56:54 +08:00
|
|
|
* xref:servlet/authentication/unpwd/form.adoc#servlet-authentication-form[Form Login]
|
|
|
|
* xref:servlet/authentication/unpwd/basic.adoc#servlet-authentication-basic[Basic Authentication]
|
|
|
|
* xref:servlet/authentication/unpwd/digest.adoc#servlet-authentication-digest[Digest Authentication]
|
2020-02-29 01:33:31 +08:00
|
|
|
|
|
|
|
[[servlet-authentication-unpwd-storage]]
|
2021-07-27 04:48:55 +08:00
|
|
|
== Storage Mechanisms
|
2020-03-03 01:56:56 +08:00
|
|
|
|
2020-02-29 01:33:31 +08:00
|
|
|
Each of the supported mechanisms for reading a username and password can leverage any of the supported storage mechanisms:
|
|
|
|
|
2021-07-31 06:02:44 +08:00
|
|
|
* Simple Storage with xref:servlet/authentication/unpwd/in-memory.adoc#servlet-authentication-inmemory[In-Memory Authentication]
|
|
|
|
* Relational Databases with xref:servlet/authentication/unpwd/jdbc.adoc#servlet-authentication-jdbc[JDBC Authentication]
|
|
|
|
* Custom data stores with xref:servlet/authentication/unpwd/user-details-service.adoc#servlet-authentication-userdetailsservice[UserDetailsService]
|
|
|
|
* LDAP storage with xref:servlet/authentication/unpwd/ldap.adoc#servlet-authentication-ldap[LDAP Authentication]
|
2020-02-29 01:33:31 +08:00
|
|
|
|