Minor faq updates

This commit is contained in:
Luke Taylor 2009-06-18 13:35:02 +00:00
parent 408e982b96
commit 44487293f0

View File

@ -13,8 +13,15 @@
requirements?</para> requirements?</para>
</question> </question>
<answer> <answer>
<para> <para> Spring Security provides you with a very flexible framework for your
Spring Security provides you with a very flexible framework for your authentication and authorization requirements, but there are many other considerations for building a secure application that are outside its scope. Web applications are vulnerable to all kinds of attacks which you should be familiar with, preferably before you start development so you can design and code with them in mind from the beginning. Check out the <link xlink:href="http://www.owasp.org/">OWASP web site</link> for information on the major issues facing web application developers and the countermeasures you can use against them.</para> authentication and authorization requirements, but there are many other
considerations for building a secure application that are outside its scope.
Web applications are vulnerable to all kinds of attacks which you should be
familiar with, preferably before you start development so you can design and
code with them in mind from the beginning. Check out the <link
xlink:href="http://www.owasp.org/">OWASP web site</link> for information
on the major issues facing web application developers and the
countermeasures you can use against them.</para>
</answer> </answer>
</qandaentry> </qandaentry>
<qandaentry xml:id="faq-web-xml"> <qandaentry xml:id="faq-web-xml">
@ -22,81 +29,102 @@
<para>Why not just use web.xml security?</para> <para>Why not just use web.xml security?</para>
</question> </question>
<answer> <answer>
<para>Let's assume you're developing an enterprise application based on Spring. There are four security concerns you typically need to address: authentication, web request security, service layer security (i.e. your methods that implement business logic), and domain object instance security (i.e. different domain objects have different permissions). With these typical requirements in mind: <orderedlist> <para>Let's assume you're developing an enterprise application based on Spring.
<listitem> There are four security concerns you typically need to address:
<para><emphasis>Authentication</emphasis>: The servlet specification provides an approach to authentication. However, you will need to configure the container to perform authentication which typically requires editing of container-specific "realm" settings. This makes a non-portable configuration, and if you need to write an actual Java class to implement the container's authentication interface, it becomes even more non-portable. With Spring Security you achieve complete portability - right down to the WAR level. Also, Spring Security offers a choice of production-proven authentication providers and mechanisms, meaning you can switch your authentication approaches at deployment time. This is particularly valuable for software vendors writing products that need to work in an unknown target environment.</para> authentication, web request security, service layer security (i.e. your
</listitem> methods that implement business logic), and domain object instance security
<listitem> (i.e. different domain objects have different permissions). With these
<para><emphasis>Web request security:</emphasis> The servlet specification provides an approach to secure your request URIs. However, these URIs can only be expressed in the servlet specification's own limited URI path format. Spring Security provides a far more comprehensive approach. For instance, you typical requirements in mind: <orderedlist>
can use Ant paths or regular expressions, you can consider parts <listitem>
of the URI other than simply the requested page (e.g. you can <para><emphasis>Authentication</emphasis>: The servlet specification
consider HTTP GET parameters) and you can implement your own provides an approach to authentication. However, you will need
runtime source of configuration data. This means your web to configure the container to perform authentication which
request security can be dynamically changed during the actual typically requires editing of container-specific "realm"
execution of your webapp.</para> settings. This makes a non-portable configuration, and if you
</listitem> need to write an actual Java class to implement the container's
<listitem> authentication interface, it becomes even more non-portable.
<para><emphasis>Service layer and domain object security:</emphasis> With Spring Security you achieve complete portability - right
The absence of support in the servlet specification for services down to the WAR level. Also, Spring Security offers a choice of
layer security or domain object instance security represent production-proven authentication providers and mechanisms,
serious limitations for multi-tiered applications. Typically meaning you can switch your authentication approaches at
developers either ignore these requirements, or implement deployment time. This is particularly valuable for software
security logic within their MVC controller code (or even worse, vendors writing products that need to work in an unknown target
inside the views). There are serious disadvantages with this environment.</para>
approach: </listitem>
<orderedlist> <listitem>
<listitem> <para><emphasis>Web request security:</emphasis> The servlet
<para><emphasis>Separation of concerns:</emphasis> specification provides an approach to secure your request URIs.
Authorization is a crosscutting concern and should However, these URIs can only be expressed in the servlet
be implemented as such. MVC controllers or views specification's own limited URI path format. Spring Security
implementing authorization code makes it more provides a far more comprehensive approach. For instance, you
difficult to test both the controller and can use Ant paths or regular expressions, you can consider parts
authorization logic, more difficult to debug, and of the URI other than simply the requested page (e.g. you can
will often lead to code duplication.</para> consider HTTP GET parameters) and you can implement your own
</listitem> runtime source of configuration data. This means your web
<listitem> request security can be dynamically changed during the actual
<para><emphasis>Support for rich clients and web execution of your webapp.</para>
services:</emphasis> If an additional client type </listitem>
must ultimately be supported, any authorization code <listitem>
embedded within the web layer is non-reusable. It <para><emphasis>Service layer and domain object security:</emphasis>
should be considered that Spring remoting exporters The absence of support in the servlet specification for services
only export service layer beans (not MVC layer security or domain object instance security represent
controllers). As such authorization logic needs to serious limitations for multi-tiered applications. Typically
be located in the services layer to support a developers either ignore these requirements, or implement
multitude of client types.</para> security logic within their MVC controller code (or even worse,
</listitem> inside the views). There are serious disadvantages with this
<listitem> approach: <orderedlist>
<para><emphasis>Layering issues:</emphasis> An MVC <listitem>
controller or view is simply the incorrect <para><emphasis>Separation of concerns:</emphasis>
architectural layer to implement authorization Authorization is a crosscutting concern and should
decisions concerning services layer methods or be implemented as such. MVC controllers or views
domain object instances. Whilst the Principal may be implementing authorization code makes it more
passed to the services layer to enable it to make difficult to test both the controller and
the authorization decision, doing so would introduce authorization logic, more difficult to debug, and
an additional argument on every services layer will often lead to code duplication.</para>
method. A more elegant approach is to use a </listitem>
ThreadLocal to hold the Principal, although this <listitem>
would likely increase development time to a point <para><emphasis>Support for rich clients and web
where it would become more economical (on a services:</emphasis> If an additional client type
cost-benefit basis) to simply use a dedicated must ultimately be supported, any authorization code
security framework.</para> embedded within the web layer is non-reusable. It
</listitem> should be considered that Spring remoting exporters
<listitem> only export service layer beans (not MVC
<para><emphasis>Authorisation code quality:</emphasis> controllers). As such authorization logic needs to
It is often said of web frameworks that they "make be located in the services layer to support a
it easier to do the right things, and harder to do multitude of client types.</para>
the wrong things". Security frameworks are the same, </listitem>
because they are designed in an abstract manner for <listitem>
a wide range of purposes. Writing your own <para><emphasis>Layering issues:</emphasis> An MVC
authorization code from scratch does not provide the controller or view is simply the incorrect
"design check" a framework would offer, and in-house architectural layer to implement authorization
authorization code will typically lack the decisions concerning services layer methods or
improvements that emerge from widespread deployment, domain object instances. Whilst the Principal may be
peer review and new versions. </para> passed to the services layer to enable it to make
</listitem> the authorization decision, doing so would introduce
</orderedlist></para> an additional argument on every services layer
</listitem> method. A more elegant approach is to use a
</orderedlist></para> ThreadLocal to hold the Principal, although this
would likely increase development time to a point
where it would become more economical (on a
cost-benefit basis) to simply use a dedicated
security framework.</para>
</listitem>
<listitem>
<para><emphasis>Authorisation code quality:</emphasis>
It is often said of web frameworks that they "make
it easier to do the right things, and harder to do
the wrong things". Security frameworks are the same,
because they are designed in an abstract manner for
a wide range of purposes. Writing your own
authorization code from scratch does not provide the
"design check" a framework would offer, and in-house
authorization code will typically lack the
improvements that emerge from widespread deployment,
peer review and new versions. </para>
</listitem>
</orderedlist></para>
</listitem>
</orderedlist></para>
<para> For simple applications, servlet specification security may just be <para> For simple applications, servlet specification security may just be
enough. Although when considered within the context of web container enough. Although when considered within the context of web container
portability, configuration requirements, limited web request security portability, configuration requirements, limited web request security
@ -113,38 +141,39 @@
<para> Spring Security 2.0.x requires a minimum JDK version of 1.4 and is built <para> Spring Security 2.0.x requires a minimum JDK version of 1.4 and is built
against Spring 2.0.x. It should also be compatible with applications using against Spring 2.0.x. It should also be compatible with applications using
Spring 2.5.x. </para> Spring 2.5.x. </para>
<para> Spring Security 3.0 requires JDK 1.5 as a minimum and will also <para> Spring Security 3.0 requires JDK 1.5 as a minimum and will also require
require Spring 3.0. </para> Spring 3.0. </para>
</answer> </answer>
</qandaentry> </qandaentry>
<qandaentry> <qandaentry xml:id="faq-start-simple">
<question> <question>
<para> <para> I'm new to Spring Security and I need to build an application that
I'm new to Spring Security and I need to build an application that supports CAS single sign-on over HTTPS, supports CAS single sign-on over HTTPS, while allowing Basic authentication
while allowing Basic authentication locally for certain URLs, authenticating against multiple back end user information sources locally for certain URLs, authenticating against multiple back end user
(LDAP and JDBC). I've copied some configuration files I found but it doesn't work. What could be wrong? information sources (LDAP and JDBC). I've copied some configuration files I
</para> found but it doesn't work. What could be wrong? </para>
<para>Or subsititute an alternative complex scenario...</para> <para>Or subsititute an alternative complex scenario...</para>
</question> </question>
<answer> <answer>
<para> <para> Realistically, you need an understanding of the technolgies you are
Realistically, you need an understanding of the technolgies you are intending to use before you can successfully intending to use before you can successfully build applications with them.
build applications with them. Security is complicated. Setting up a simple configuration using a login Security is complicated. Setting up a simple configuration using a login
form and some hard-coded users using Spring Security's namespace is reasonably straightforward. Moving to using a form and some hard-coded users using Spring Security's namespace is
backed JDBC database is also easy enough. But if you try and jump reasonably straightforward. Moving to using a backed JDBC database is also
straight to a complicated deployment scenario like this you will almost certainly be frustrated. easy enough. But if you try and jump straight to a complicated deployment
There is a big jump in the learning curve required to set up systems like CAS, configure LDAP servers and install SSL scenario like this you will almost certainly be frustrated. There is a big
certificates properly. So you need to take things one step at a time. jump in the learning curve required to set up systems like CAS, configure
</para> LDAP servers and install SSL certificates properly. So you need to take
<para> things one step at a time. </para>
From a Spring Security perspective, the first thing you should do is follow the <quote>Getting Started</quote> <para> From a Spring Security perspective, the first thing you should do is
guide on the web site. This will take you through a series of steps to get up and running and get some idea of follow the <quote>Getting Started</quote> guide on the web site. This will
how the framework operates. If you are using other technologies which you aren't familiar with then you should take you through a series of steps to get up and running and get some idea
do some research and try to make sure you can use them in isolation before combining them in a complex system. of how the framework operates. If you are using other technologies which you
aren't familiar with then you should do some research and try to make sure
you can use them in isolation before combining them in a complex system.
</para> </para>
</answer> </answer>
</qandaentry> </qandaentry>
</qandadiv> </qandadiv>
<qandadiv> <qandadiv>
<title>Common Problems</title> <title>Common Problems</title>
@ -211,8 +240,8 @@
<answer> <answer>
<para> This happens because Tomcat sessions created under HTTPS cannot <para> This happens because Tomcat sessions created under HTTPS cannot
subsequently be used under HTTP and any session state is lost (including the subsequently be used under HTTP and any session state is lost (including the
security context information). Starting a session in HTTP first should work as the security context information). Starting a session in HTTP first should work
session cookie won't be marked as secure. </para> as the session cookie won't be marked as secure. </para>
</answer> </answer>
</qandaentry> </qandaentry>
<qandaentry xml:id="faq-no-security-on-forward"> <qandaentry xml:id="faq-no-security-on-forward">
@ -246,27 +275,52 @@
</programlisting> </programlisting>
</answer> </answer>
</qandaentry> </qandaentry>
<qandaentry xml:id="faq-no-filters-no-context">
<question>
<para>I have a user who has definitely been authenticated, but when I try to
access the <classname>SecurityContextHolder</classname> during some
requests, the <interfacename>Authentication</interfacename> is null. Why
can't I see the user information? </para>
</question>
<answer>
<para>If you have excluded the request from the security filter chain using the
attribute <literal>filters='none'</literal> in the
<literal>&lt;intercept-url></literal> element that matches the URL
pattern, then the <classname>SecurityContextHolder</classname> will not be
populated for that request. Check the debug log to see whether the request
is passing through the filter chain. (You are reading the debug log,
right?).</para>
</answer>
</qandaentry>
</qandadiv> </qandadiv>
<qandadiv> <qandadiv>
<title>Spring Security Architecture Questions</title> <title>Spring Security Architecture Questions</title>
<qandaentry xml:id="faq-where-is-class-x"> <qandaentry xml:id="faq-where-is-class-x">
<question><para>How do I know which package class X is in?</para></question> <question>
<answer><para>The best way of locating classes is by installing the Spring Security source in your IDE. <para>How do I know which package class X is in?</para>
The distribution includes source jars for each of the modules the project is divided up into. </question>
Add these to your project source path and you can navigate directly to Spring Security classes <answer>
(<command>Ctrl-Shift-T</command> in Eclipse). This also makes debugging easer and allows you to troubleshoot <para>The best way of locating classes is by installing the Spring Security
exceptions by looking directly at the code where they occur to see what's going on there. source in your IDE. The distribution includes source jars for each of the
</para></answer> modules the project is divided up into. Add these to your project source
path and you can navigate directly to Spring Security classes
(<command>Ctrl-Shift-T</command> in Eclipse). This also makes debugging
easer and allows you to troubleshoot exceptions by looking directly at the
code where they occur to see what's going on there. </para>
</answer>
</qandaentry> </qandaentry>
<qandaentry xml:id="faq-namespace-to-bean-mapping"> <qandaentry xml:id="faq-namespace-to-bean-mapping">
<question><para>How do the namespace elements map to conventional bean configurations?</para></question> <question>
<para>How do the namespace elements map to conventional bean
configurations?</para>
</question>
<answer> <answer>
<para>There is a general overview of what beans are created by the namespace in the namespace <para>There is a general overview of what beans are created by the namespace in
appendix of the reference guide. If want to know the full details then the code the namespace appendix of the reference guide. If want to know the full
is in the <filename>spring-security-config</filename> module within the Spring Security 3.0 details then the code is in the <filename>spring-security-config</filename>
distribution. You should probably read the chapters on namespace parsing in the module within the Spring Security 3.0 distribution. You should probably read
standard Spring Framework reference documentation first. the chapters on namespace parsing in the standard Spring Framework reference
</para> documentation first. </para>
</answer> </answer>
</qandaentry> </qandaentry>
</qandadiv> </qandadiv>
@ -298,52 +352,57 @@
and loads the appropriate user data for authentication. </para> and loads the appropriate user data for authentication. </para>
</answer> </answer>
</qandaentry> </qandaentry>
<qandaentry> <qandaentry xml:id="faq-dynamic-url-metadata">
<question xml:id="faq-dynamic-url-metadata"> <question>
<para>How do I define the secured URLs withing an application dynamically?</para> <para>How do I define the secured URLs withing an application
dynamically?</para>
</question> </question>
<answer> <answer>
<para>People often ask about how to store the mapping between secured URLs and <para>People often ask about how to store the mapping between secured URLs and
security metadata attributes in a database, rather than in the application security metadata attributes in a database, rather than in the application
context. context. </para>
</para> <para> The first thing you should ask yourself is if you really need to do this.
<para> If an application requires securing, then it also requires that the security
The first thing you should ask yourself is if you really need to do this. If an be tested thoroughly based on a defined policy. It may require auditing and
application requires securing, then it also requires that the security be tested acceptance testing before being rolled out into a production environment. A
thoroughly based on a defined policy. It may require auditing and acceptance security-conscious organization should be aware that the benefits of their
testing before being rolled out into a production environment. A security-conscious diligent testing process could be wiped out instantly by allowing the
organization should be aware that the benefits of their diligent testing process could security settings to be modified at runtime by changing a row or two in a
be wiped out instantly by allowing the security settings to be modified at runtime configuration database. If you have taken this into account (perhaps using
by changing a row or two in a configuration database. multiple layers of security within your application) then Spring Security
If you have taken this into account (perhaps using multiple layers of security within your allows you to fully customize the source of security metadata. You can make
application) then Spring Security allows you to fully customize the source of security metadata. it fully dynamic if you choose. </para>
You can make it fully dynamic if you choose. <para> Both method and web security are protected by subclasses of
</para> <classname>AbstractSecurityInterceptor</classname> which is configured
<para> with a <interfacename>SecurityMetadataSource</interfacename> from which it
Both method and web security are protected by subclasses of obtains the metadata for a particular method or filter invocation <footnote>
<classname>AbstractSecurityInterceptor</classname> which is configured with a <para>This class previouly went by the rather obscure name of
<interfacename>SecurityMetadataSource</interfacename> from which it obtains <classname>ObjectDefinitionSource</classname>, but has been
the metadata for a particular method or filter invocation <footnote><para>This renamed in Spring Security 3.0</para>
class previouly went by the rather obscure name of <classname>ObjectDefinitionSource</classname>, </footnote>. For web security, the interceptor class is
but has been renamed in Spring Security 3.0</para></footnote>. For web security, the <classname>FilterSecurityInterceptor</classname> and it uses the marker
interceptor class is <classname>FilterSecurityInterceptor</classname> and it uses interface
the marker interface <interfacename>FilterInvocationSecurityMetadataSource</interfacename>. <interfacename>FilterInvocationSecurityMetadataSource</interfacename>.
The <quote>secured object</quote> type it operates on is a <classname>FilterInvocation</classname>. The <quote>secured object</quote> type it operates on is a
The default implementation which is used (both in the namespace <literal>&lt;http&gt;</literal> <classname>FilterInvocation</classname>. The default implementation
and when configuring the interceptor explicitly, stores the list of URL patterns and their which is used (both in the namespace <literal>&lt;http&gt;</literal> and
corresponding list of <quote>configuration attributes</quote> (instances of <interfacename>ConfigAttribute</interfacename>) when configuring the interceptor explicitly, stores the list of URL patterns
in an in-memory map. and their corresponding list of <quote>configuration attributes</quote>
</para> (instances of <interfacename>ConfigAttribute</interfacename>) in an
<para> in-memory map. </para>
To load the data from an alternative source, you must be using an explicitly declared security filter <para> To load the data from an alternative source, you must be using an
chain (typically Spring Security's <classname>FilterChainProxy</classname>) in order to customize the explicitly declared security filter chain (typically Spring Security's
<classname>FilterSecurityInterceptor</classname> bean. You can't use the namespace. You would then implement <classname>FilterChainProxy</classname>) in order to customize the
<interfacename>FilterInvocationSecurityMetadataSource</interfacename> to load the data as you please for <classname>FilterSecurityInterceptor</classname> bean. You can't use the
a particular <classname>FilterInvocation</classname><footnote><para>The <classname>FilterInvocation</classname> namespace. You would then implement
object contains the <classname>HttpServletRequest</classname>, so you can obtain the URL or any other <interfacename>FilterInvocationSecurityMetadataSource</interfacename> to
relevant information on which to base your decision on what the list of returned attributes will contain.</para></footnote>. load the data as you please for a particular
A very basic outline would look something like this: <classname>FilterInvocation</classname><footnote>
<programlisting language="java"><![CDATA[ <para>The <classname>FilterInvocation</classname> object contains the
<classname>HttpServletRequest</classname>, so you can obtain the
URL or any other relevant information on which to base your decision
on what the list of returned attributes will contain.</para>
</footnote>. A very basic outline would look something like this: <programlisting language="java"><![CDATA[
public class MyFilterSecurityMetadataSource implements FilterInvocationSecurityMetadataSource { public class MyFilterSecurityMetadataSource implements FilterInvocationSecurityMetadataSource {
public List<ConfigAttribute> getAttributes(Object object) { public List<ConfigAttribute> getAttributes(Object object) {
@ -366,8 +425,8 @@
return FilterInvocation.class.isAssignableFrom(clazz); return FilterInvocation.class.isAssignableFrom(clazz);
} }
} }
]]></programlisting> ]]></programlisting> For more information, look at the code for
For more information, look at the code for <classname>DefaultFilterInvocationSecurityMetadataSource</classname>. <classname>DefaultFilterInvocationSecurityMetadataSource</classname>.
</para> </para>
</answer> </answer>
</qandaentry> </qandaentry>
@ -377,45 +436,45 @@
Spring Security?</para> Spring Security?</para>
</question> </question>
<answer> <answer>
<para>It will depend on what features you <para>It will depend on what features you are using and what type of application
are using and what type of application you are developing. With Spring Security 3.0, you are developing. With Spring Security 3.0, the project jars are divided
the project jars are divided into clearly distinct areas of functionality, so it is into clearly distinct areas of functionality, so it is straightforward to
straightforward to work out which Spring Security jars you need from your application requirements. work out which Spring Security jars you need from your application
All applications will need the <filename>spring-security-core</filename> jar. requirements. All applications will need the
If you're developing a web application, <filename>spring-security-core</filename> jar. If you're developing a
you need the <filename>spring-security-web</filename> jar. If you're using security namespace web application, you need the <filename>spring-security-web</filename> jar.
configuration you need the <filename>spring-security-config</filename> jar, for LDAP support you need the If you're using security namespace configuration you need the
<filename>spring-security-ldap</filename> jar and so on. <filename>spring-security-config</filename> jar, for LDAP support you
</para> need the <filename>spring-security-ldap</filename> jar and so on. </para>
<para> <para> For third-party jars the situation isn't always quite so obvious. A good
For third-party jars the situation isn't always quite so obvious. starting point is to copy those from one of the pre-built sample
A good starting point is to copy those from one of the applications WEB-INF/lib directories. For a basic application, you can start
pre-built sample applications WEB-INF/lib directories. For a basic with the tutorial sample. If you want to use LDAP, with an embedded test
application, you can start with the tutorial sample. If you want to use server, then use the LDAP sample as a starting point. </para>
LDAP, with an embedded test server, then use the LDAP sample as a starting
point. </para>
<para> If you are building your project with maven, then adding the appropriate <para> If you are building your project with maven, then adding the appropriate
Spring Security modules as dependencies to your pom.xml will automatically pull in the core Spring Security modules as dependencies to your pom.xml will automatically
jars that the framework requires. Any which are marked as "optional" in the pull in the core jars that the framework requires. Any which are marked as
Spring Security POM files will have to be added to your own pom.xml file if "optional" in the Spring Security POM files will have to be added to your
you need them. </para> own pom.xml file if you need them. </para>
</answer> </answer>
</qandaentry> </qandaentry>
<qandaentry xml:id="faq-ldap-authorities"> <qandaentry xml:id="faq-ldap-authorities">
<question><para>How do I authenticate against LDAP but load user roles from a database?</para></question> <question>
<para>How do I authenticate against LDAP but load user roles from a
database?</para>
</question>
<answer> <answer>
<para> <para> The <code>LdapAuthenticationProvider</code> bean (which handles normal
The <code>LdapAuthenticationProvider</code> bean (which handles normal LDAP authentication in Spring LDAP authentication in Spring Security) is configured with two separate
Security) is configured with two separate strategy interfaces, one strategy interfaces, one which performs the authenticatation and one which
which performs the authenticatation and one which loads the user authorities, called loads the user authorities, called
<interfacename>LdapAuthenticator</interfacename> and <interfacename>LdapAuthoritiesPopulator</interfacename> <interfacename>LdapAuthenticator</interfacename> and
respectively. The <classname>DefaultLdapAuthoitiesPopulator</classname> loads the user authorities <interfacename>LdapAuthoritiesPopulator</interfacename> respectively.
from the LDAP directory and has various configuration parameters to allow you to The <classname>DefaultLdapAuthoitiesPopulator</classname> loads the user
specify how these should be retrieved. authorities from the LDAP directory and has various configuration parameters
</para> to allow you to specify how these should be retrieved. </para>
<para> <para> To use JDBC instead, you can implement the interface yourself, using
To use JDBC instead, you can implement the interface yourself, using whatever SQL is appropriate for your schema: whatever SQL is appropriate for your schema: <programlisting language="java"><![CDATA[
<programlisting language="java"><![CDATA[
public class MyAuthoritiesPopulator implements LdapAuthoritiesPopulator { public class MyAuthoritiesPopulator implements LdapAuthoritiesPopulator {
@Autowired @Autowired
JdbcTemplate template; JdbcTemplate template;
@ -432,13 +491,12 @@
} }
} }
} }
]]></programlisting> ]]></programlisting> You would then add a bean of this type to your application context and inject
You would then add a bean of this type to your application context and inject it into the <code>LdapAuthenticationProvider</code>. it into the <code>LdapAuthenticationProvider</code>. This is covered in the
This is covered in the section on configuring LDAP using explicit Spring beans in the LDAP chapter of the reference manual. section on configuring LDAP using explicit Spring beans in the LDAP chapter
Note that you can't use the namespace for configuration in this case. of the reference manual. Note that you can't use the namespace for
You should also consult the Javadoc for the relevant classes and interfaces. configuration in this case. You should also consult the Javadoc for the
</para> relevant classes and interfaces. </para>
</answer> </answer>
</qandaentry> </qandaentry>
</qandadiv> </qandadiv>