In summary, this filter is responsible for processing any request that has a HTTP request header of Authorization
with an authentication scheme of Basic
and a Base64-encoded username:password
token. For example, to authenticate user "Aladdin" with password "open sesame" the following header would be presented:
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
This filter can be used to provide BASIC authentication services to both remoting protocol clients (such as Hessian and SOAP) as well as standard user agents (such as Internet Explorer and Netscape).
If authentication is successful, the resulting {@link Authentication} object will be placed into theSecurityContextHolder
.
If authentication fails and ignoreFailure
is false
(the default), an {@link AuthenticationEntryPoint} implementation is called (unless the ignoreFailure property is set totrue). Usually this should be {@link BasicAuthenticationEntryPoint}, which will prompt the user to authenticate again via BASIC authentication.
Basic authentication is an attractive protocol because it is simple and widely deployed. However, it still transmits a password in clear text and as such is undesirable in many situations. Digest authentication is also provided by Spring Security and should be used instead of Basic authentication wherever possible. See {@link org.springframework.security.web.authentication.www.DigestAuthenticationFilter}.
Note that if a {@link RememberMeServices} is set, this filter will automatically send back remember-medetails to the client. Therefore, subsequent requests will not need to present a BASIC authentication header as they will be authenticated using the remember-me mechanism. @author Ben Alex
|
|
|
|
|
|
|
|