diff --git a/docs/manual/src/docbook/appendix-namespace.xml b/docs/manual/src/docbook/appendix-namespace.xml index 9eeed1bee4..b51b54448c 100644 --- a/docs/manual/src/docbook/appendix-namespace.xml +++ b/docs/manual/src/docbook/appendix-namespace.xml @@ -524,7 +524,7 @@ -
+
Authentication Services Before Spring Security 3.0, an AuthenticationManager was automatically registered internally. Now you must register one explicitly using the @@ -545,6 +545,11 @@ described in the namespace introduction. All elements which create AuthenticationProvider instances should be children of this element. + + The element also exposes an erase-credentials attribute which maps + to the eraseCredentialsAfterAuthentication property of + the ProviderManager. This is discussed in the + Core Services chapter.
The <literal><authentication-provider></literal> Element Unless used with a ref attribute, this element is diff --git a/docs/manual/src/docbook/core-services.xml b/docs/manual/src/docbook/core-services.xml index 69158e6b16..e4f081595d 100644 --- a/docs/manual/src/docbook/core-services.xml +++ b/docs/manual/src/docbook/core-services.xml @@ -71,6 +71,28 @@ concerned about this, because if you forget to register a suitable provider, you'll simply receive a ProviderNotFoundException when an attempt to authenticate is made. +
+ Erasing Credentials on Successful Authentication + + By default (from Spring Security 3.1 onwards) the ProviderManager + will attempt to clear any sensitive credentials information from the + Authentication object which is returned by a successful + authentication request. This prevents information like passwords being retained longer + than necessary. + + + This may cause issues when you are using a cache of user objects, for example, to + improve performance in a stateless application. If the Authentication + contains a reference to an object in the cache (such as a UserDetails + instance) and this has its credentials removed, then it will no longer be possible to authenticate + against the cached value. You need to take this into account if you are using a cache. An obvious + solution is to make a copy of the object first, either in the cache implementation or in + the AuthenticationProvider which creates the returned + Authentication object. Alternatively, you can disable the + eraseCredentialsAfterAuthentication property on ProviderManager. + See the Javadoc for more information. + +
<literal>DaoAuthenticationProvider</literal> The simplest AuthenticationProvider implemented by