From f88b6f75ffc5bacbd22753928b386023b1b7f954 Mon Sep 17 00:00:00 2001 From: Rob Winch Date: Fri, 11 Nov 2011 09:00:53 -0500 Subject: [PATCH] SEC-1858: Overhall the namespace appendix of the reference to include missing elements and attributes --- .../manual/src/docbook/appendix-namespace.xml | 2529 ++++++++++++----- .../manual/src/docbook/jaas-auth-provider.xml | 2 +- docs/manual/src/docbook/samples.xml | 2 +- 3 files changed, 1883 insertions(+), 650 deletions(-) diff --git a/docs/manual/src/docbook/appendix-namespace.xml b/docs/manual/src/docbook/appendix-namespace.xml index ea5a981cb8..1c58daa1f9 100644 --- a/docs/manual/src/docbook/appendix-namespace.xml +++ b/docs/manual/src/docbook/appendix-namespace.xml @@ -17,228 +17,344 @@ an XSD schema. If you are familiar with this format, you may wish to examine the schema file directly. -
- Web Application Security - the <literal><http></literal> Element - If you use an <http> element within your application, a - FilterChainProxy bean named "springSecurityFilterChain" is - created and the configuration within the element is used to build a filter chain within - FilterChainProxy. As of Spring Security 3.1, additional - http elements can be used to add extra filter chains - See the introductory chapter for how to set - up the mapping from your web.xml - . Some core filters are always created in a filter chain and others will be - added to the stack depending on the attributes and child elements which are present. The - positions of the standard filters are fixed (see the - filter order table in the namespace introduction), removing a common source of - errors with previous versions of the framework when users had to configure the filter - chain explicitly in theFilterChainProxy bean. You can, of course, - still do this if you need full control of the configuration. - All filters which require a reference to the - AuthenticationManager will be automatically injected with - the internal instance created by the namespace configuration (see the introductory chapter for more on the - AuthenticationManager). - Each <http> namespace block always creates an - SecurityContextPersistenceFilter, an - ExceptionTranslationFilter and a - FilterSecurityInterceptor. These are fixed and cannot be replaced - with alternatives. -
- <literal><http></literal> Attributes - The attributes on the <http> element control some of the - properties on the core filters. -
- <literal>pattern</literal> - Defining a pattern for the http element controls the - requests which will be filtered through the list of filters which it defines. - The interpretation is dependent on the configured request-matcher. If no pattern is defined, - all requests will be matched, so the most specific patterns should be declared - first. +
+ Web Application Security +
+ <literal><debug></literal> + Enables Spring Security debugging infrastructure. This will provide human-readable (multi-line) + debugging information to monitor requests coming into the security filters. This may include sensitive + information, such as request parameters or headers, and should only be used in a development + environment. +
+
+ <literal><http></literal> + If you use an <http> element within your application, a + FilterChainProxy bean named "springSecurityFilterChain" is + created and the configuration within the element is used to build a filter chain within + FilterChainProxy. As of Spring Security 3.1, additional + http elements can be used to add extra filter chains + See the introductory chapter for how to set + up the mapping from your web.xml + . Some core filters are always created in a filter chain and others will be + added to the stack depending on the attributes and child elements which are present. The + positions of the standard filters are fixed (see the + filter order table in the namespace introduction), removing a common source of + errors with previous versions of the framework when users had to configure the filter + chain explicitly in the FilterChainProxy bean. You can, of course, + still do this if you need full control of the configuration. + All filters which require a reference to the + AuthenticationManager will be automatically injected with + the internal instance created by the namespace configuration (see the introductory chapter for more on the + AuthenticationManager). + Each <http> namespace block always creates an + SecurityContextPersistenceFilter, an + ExceptionTranslationFilter and a + FilterSecurityInterceptor. These are fixed and cannot be replaced + with alternatives. +
+ <literal><http></literal> Attributes + The attributes on the <http> element control some of the + properties on the core filters. +
+ <literal>access-decision-manager-ref</literal> + Optional attribute specifying the ID of the + AccessDecisionManager implementation which should + be used for authorizing HTTP requests. By default an + AffirmativeBased implementation is used for with a + RoleVoter and an + AuthenticatedVoter. +
+
+ <literal>access-denied-page</literal> + Deprecated in favour of the access-denied-handler + child element. +
+
+ <literal>authentication-manager-ref</literal> + A reference to the AuthenticationManager used for the + FilterChain created by this http element. +
+
+ <literal>auto-config</literal> + Automatically registers a login form, BASIC authentication, anonymous authentication, logout + services, remember-me and servlet-api-integration. If set to "true", all of these capabilities are added + (although you can still customize the configuration of each by providing the respective element). If + unspecified, defaults to "false". +
+
+ <literal>create-session</literal> + Controls the eagerness with which an HTTP session is created by Spring Security classes. + Options include: + + + always - Spring Security will proactively create a session if one + does not exist. + + + ifRequired - Spring Security will only create a session only if one + is required (default value). + + + never - Spring Security will never create a session, but will + make use of one if the application does. + + stateless - Spring Security will not create a session and ignore the + session for obtaining a Spring Authentication. + + + +
+
+ <literal>disable-url-rewriting</literal> + Prevents session IDs from being appended to URLs in the application. Clients + must use cookies if this attribute is set to true. The default is + false. +
+
+ <literal>entry-point-ref</literal> + Normally the AuthenticationEntryPoint used + will be set depending on which authentication mechanisms have been configured. + This attribute allows this behaviour to be overridden by defining a customized + AuthenticationEntryPoint bean which will start + the authentication process. +
+
+ <literal>jaas-api-provision</literal> + If available, runs the request as the Subject acquired from + the JaasAuthenticationToken which is implemented by + adding a JaasApiIntegrationFilter bean to the stack. + Defaults to false. +
+
+ <literal>name</literal> + A bean identifier, used for referring to the bean elsewhere in the context. +
+
+ <literal>once-per-request</literal> + Corresponds to the observeOncePerRequest property of + FilterSecurityInterceptor. Defaults to true. +
+
+ <literal>path-type</literal> + Deprecated in favor of request-matcher. + +
+
+ <literal>pattern</literal> + Defining a pattern for the http element controls the + requests which will be filtered through the list of filters which it defines. + The interpretation is dependent on the configured request-matcher. If no pattern is defined, + all requests will be matched, so the most specific patterns should be declared + first. +
+
+ <literal>realm</literal> + Sets the realm name used for basic authentication (if enabled). Corresponds + to the realmName property on + BasicAuthenticationEntryPoint. +
+
+ <literal>request-matcher</literal> + Defines the RequestMatcher strategy used in + the FilterChainProxy and the beans created by the + intercept-url to match incoming requests. Options are + currently ant, regex and + ciRegex, for ant, regular-expression and case-insensitive + regular-expression repsectively. A separate instance is created for each + intercept-url element using its + pattern and + method attributes. Ant paths + are matched using an AntPathRequestMatcher and regular expressions + are matched using a RegexRequestMatcher. See the Javadoc + for these classes for more details on exactly how the matching is preformed. Ant + paths are the default strategy. +
+
+ <literal>request-matcher-ref</literal> + A referenece to a bean that implements RequestMatcher that + will determine if this FilterChain should be used. This is a more + powerful alternative to pattern. +
+
+ <literal>security</literal> + A request pattern can be mapped to an empty filter chain, by setting this + attribute to none. No security will be applied and none of + Spring Security's features will be available. +
+
+ <literal>security-context-repository-ref</literal> + Allows injection of a custom + SecurityContextRepository into the + SecurityContextPersistenceFilter. +
+
+ <literal>servlet-api-provision</literal> + Provides versions of HttpServletRequest security methods + such as isUserInRole() and getPrincipal() + which are implemented by adding a + SecurityContextHolderAwareRequestFilter bean to the + stack. Defaults to true. +
+
+ <literal>use-expressions</literal> + Enables EL-expressions in the access attribute, as + described in the chapter on expression-based + access-control. +
-
- <literal>security</literal> - A request pattern can be mapped to an empty filter chain, by setting this - attribute to none. No security will be applied and none of - Spring Security's features will be available. -
-
- <literal>servlet-api-provision</literal> - Provides versions of HttpServletRequest security methods - such as isUserInRole() and getPrincipal() - which are implemented by adding a - SecurityContextHolderAwareRequestFilter bean to the - stack. Defaults to "true". -
-
- <literal>jaas-api-provision</literal> - If available, runs the request as the Subject acquired from - the JaasAuthenticationToken which is implemented by - adding a JaasApiIntegrationFilter bean to the stack. - Defaults to "false". -
-
- <literal>request-matcher</literal> - Defines the RequestMatcher strategy used in - the FilterChainProxy and the beans created by the - intercept-url to match incoming requests. Options are - currently ant, regex and - ciRegex, for ant, regular-expression and case-insensitive - regular-expression repsectively. A separate instance is created for each - intercept-url element using its pattern - and method attributes (see below). Ant paths are matched - using an AntPathRequestMatcher and regular expressions - are matched using a RegexRequestMatcher. See the Javadoc - for these classes for more details on exactly how the matching is preformed. Ant - paths are the default strategy. -
-
- <literal>realm</literal> - Sets the realm name used for basic authentication (if enabled). Corresponds - to the realmName property on - BasicAuthenticationEntryPoint. -
-
- <literal>entry-point-ref</literal> - Normally the AuthenticationEntryPoint used - will be set depending on which authentication mechanisms have been configured. - This attribute allows this behaviour to be overridden by defining a customized - AuthenticationEntryPoint bean which will start - the authentication process. -
-
- <literal>security-context-repository-ref</literal> - Allows injection of a custom - SecurityContextRepository into the - SecurityContextPersistenceFilter. -
-
- <literal>access-decision-manager-ref</literal> - Optional attribute specifying the ID of the - AccessDecisionManager implementation which should - be used for authorizing HTTP requests. By default an - AffirmativeBased implementation is used for with a - RoleVoter and an - AuthenticatedVoter. -
-
- <literal>access-denied-page</literal> - Deprecated in favour of the access-denied-handler child - element. -
-
- <literal>once-per-request</literal> - Corresponds to the observeOncePerRequest property of - FilterSecurityInterceptor. Defaults to "true". -
-
- <literal>create-session</literal> - Controls the eagerness with which an HTTP session is created. If not set, - defaults to "ifRequired". Other options are "always" and "never". The setting of - this attribute affect the allowSessionCreation and - forceEagerSessionCreation properties of - HttpSessionContextIntegrationFilter. - allowSessionCreation will always be true unless this - attribute is set to "never". forceEagerSessionCreation is - "false" unless it is set to "always". So the default configuration allows - session creation but does not force it. The exception is if concurrent session - control is enabled, when forceEagerSessionCreation will be - set to true, regardless of what the setting is here. Using "never" would then - cause an exception during the initialization of - HttpSessionContextIntegrationFilter. -
-
- <literal>use-expressions</literal> - Enables EL-expressions in the access attribute, as - described in the chapter on expression-based - access-control. -
-
- <literal>disable-url-rewriting</literal> - Prevents session IDs from being appended to URLs in the application. Clients - must use cookies if this attribute is set to true. +
+ Child Elements of <http> + + access-denied-handler + anonymous + custom-filter + expression-handler + form-login + http-basic + intercept-url + jee + logout + openid-login + port-mappings + remember-me + request-cache + session-management + x509 +
- <literal><access-denied-handler></literal> - This element allows you to set the errorPage property for the + <literal><access-denied-handler></literal> + This element allows you to set the errorPage property for the default AccessDeniedHandler used by the - ExceptionTranslationFilter, (using the - error-page attribute, or to supply your own implementation using - the ref attribute. This is discussed in more detail in the - section on the + ExceptionTranslationFilter, using the + error-page attribute, or + to supply your own implementation using the + ref attribute. This is discussed + in more detail in the section on the ExceptionTranslationFilter. -
-
- The <literal><intercept-url></literal> Element - This element is used to define the set of URL patterns that the application is - interested in and to configure how they should be handled. It is used to construct - the FilterInvocationSecurityMetadataSource used by - the FilterSecurityInterceptor. It is also responsible for - configuring a ChannelAuthenticationFilter if particular URLs - need to be accessed by HTTPS, for example. When matching the specified patterns - against an incoming request, the matching is done in the order in which the elements - are declared. So the most specific matches patterns should come first and the most - general should come last. -
- <literal>pattern</literal> - The pattern which defines the URL path. The content will depend on the - request-matcher attribute from the containing http element, - so will default to ant path syntax. +
+ Parent Elements of <literal><access-denied-handler></literal> + + http +
-
- <literal>method</literal> - The HTTP Method which will be used in combination with the pattern to match - an incoming request. If omitted, any method will match. If an identical pattern - is specified with and without a method, the method-specific match will take - precedence. -
-
- <literal>access</literal> - Lists the access attributes which will be stored in the - FilterInvocationSecurityMetadataSource for the - defined URL pattern/method combination. This should be a comma-separated list of - the security configuration attributes (such as role names). -
-
- <literal>requires-channel</literal> - Can be http or https depending on whether a - particular URL pattern should be accessed over HTTP or HTTPS respectively. - Alternatively the value any can be used when there is no - preference. If this attribute is present on any - <intercept-url> element, then a - ChannelAuthenticationFilter will be added to the filter - stack and its additional dependencies added to the application - context. - If a <port-mappings> configuration is added, this - will be used to by the SecureChannelProcessor and - InsecureChannelProcessor beans to determine the ports - used for redirecting to HTTP/HTTPS. -
-
- <literal>filters</literal> - Can only take the value none. This will cause any matching - request to bypass the Spring Security filter chain entirely. None of the rest of - the <http> configuration will have any effect on the - request and there will be no security context available for its duration. Access - to secured methods during the request will fail. +
+ <literal><access-denied-handler></literal> Attributes +
+ <literal>error-page</literal> + The access denied page that an authenticated user will be redirected to if they request a + page which they don't have the authority to access. +
+
+ <literal>ref</literal> + Defines a reference to a Spring bean of type AccessDeniedHandler + . +
-
- The <literal><port-mappings></literal> Element - By default, an instance of PortMapperImpl will be added to - the configuration for use in redirecting to secure and insecure URLs. This element - can optionally be used to override the default mappings which that class defines. - Each child <port-mapping> element defines a pair of - HTTP:HTTPS ports. The default mappings are 80:443 and 8080:8443. An example of - overriding these can be found in the namespace introduction. +
+ <literal><anonymous></literal> + Adds an AnonymousAuthenticationFilter to the stack and an + AnonymousAuthenticationProvider. Required if you are using + the IS_AUTHENTICATED_ANONYMOUSLY attribute. +
+ Parent Elements of <literal><anonymous></literal> + + http + +
+
+ <literal><anonymous></literal> Attributes +
+ <literal>enabled</literal> + With the default namespace setup, the anonymous "authentication" facility is automatically + enabled. You can disable it using this property. +
+
+ <literal>granted-authority</literal> + The granted authority that should be assigned to the anonymous request. Commonly this is used + to assign the anonymous request particular roles, which can subsequently be used in authorization + decisions. If unset, defaults to ROLE_ANONYMOUS. +
+
+ <literal>key</literal> + The key shared between the provider and filter. This generally does not need to be set. If + unset, it will default to a secure randomly generated value. This means setting this value can + improve startup time when using the anonymous functionality since secure random values can take + a while to be generated. +
+
+ <literal>username</literal> + The username that should be assigned to the anonymous request. This allows the principal to + be identified, which may be important for logging and auditing. if unset, defaults to + anonymousUser. +
+
+
+
+ <literal><custom-filter></literal> + This element is used to add a filter to the filter chain. It doesn't create any + additional beans but is used to select a bean of type + javax.servlet.Filter which is already defined in the + application context and add that at a particular position in the filter chain + maintained by Spring Security. Full details can be found in the + namespace chapter. +
+ Parent Elements of <literal><custom-filter></literal> + + http + +
+
+ <literal><custom-filter></literal> Attributes +
+ <literal>after</literal> + The filter immediately after which the custom-filter should be placed in the chain. This + feature will only be needed by advanced users who wish to mix their own filters into the + security filter chain and have some knowledge of the standard Spring Security filters. The + filter names map to specific Spring Security implementation filters. +
+
+ <literal>before</literal> + The filter immediately before which the custom-filter should be placed in the chain +
+
+ <literal>position</literal> + The explicit position at which the custom-filter should be placed in the chain. Use if you + are replacing a standard filter. +
+
+ <literal>ref</literal> + Defines a reference to a Spring bean that implements Filter. +
+
+
+
+ <literal><expression-handler></literal> + Defines the SecurityExpressionHandler instance which will be used if + expression-based access-control is enabled. A default implementation (with no ACL support) will be used + if not supplied. +
+ Parent Elements of <literal><expression-handler></literal> + + global-method-security + http + +
+
+ <literal><expression-handler></literal> Attributes +
+ <literal>ref</literal> + Defines a reference to a Spring bean that implements SecurityExpressionHandler. +
+
- The <literal><form-login></literal> Element - Used to add an UsernamePasswordAuthenticationFilter to the + <literal><form-login></literal> + Used to add an UsernamePasswordAuthenticationFilter to the filter stack and an LoginUrlAuthenticationEntryPoint to the application context to provide authentication on demand. This will always take precedence over other namespace-created entry points. If no attributes are supplied, @@ -249,172 +365,613 @@ DefaultLoginPageGeneratingFilter is responsible for rendering the login page and will provide login forms for both normal form login and/or OpenID if required. - The behaviour can be customized using the following attributes. -
- <literal>login-page</literal> - The URL that should be used to render the login page. Maps to the - loginFormUrl property of the - LoginUrlAuthenticationEntryPoint. Defaults to - "/spring_security_login". + The behaviour can be customized using the + <form-login> Attributes. +
+ Parent Elements of <literal><form-login></literal> + + http +
-
- <literal>login-processing-url</literal> - Maps to the filterProcessesUrl property of - UsernamePasswordAuthenticationFilter. The default value - is "/j_spring_security_check". -
-
- <literal>default-target-url</literal> - Maps to the defaultTargetUrl property of - UsernamePasswordAuthenticationFilter. If not set, the - default value is "/" (the application root). A user will be taken to this URL - after logging in, provided they were not asked to login while attempting to - access a secured resource, when they will be taken to the originally requested - URL. -
-
- <literal>always-use-default-target</literal> - If set to "true", the user will always start at the value given by - default-target-url, regardless of how they arrived at the - login page. Maps to the alwaysUseDefaultTargetUrl property of - UsernamePasswordAuthenticationFilter. Default value is - "false". -
-
- <literal>authentication-failure-url</literal> - Maps to the authenticationFailureUrl property of - UsernamePasswordAuthenticationFilter. Defines the URL the - browser will be redirected to on login failure. Defaults to - "/spring_security_login?login_error", which will be automatically handled by the - automatic login page generator, re-rendering the login page with an error - message. -
-
- <literal>authentication-success-handler-ref</literal> - This can be used as an alternative to default-target-url - and always-use-default-target, giving you full control over - the navigation flow after a successful authentication. The value should be the - name of an AuthenticationSuccessHandler bean in - the application context. By default, an imlementation of - SavedRequestAwareAuthenticationSuccessHandler is used and - injected with the default-target-url. -
-
- <literal>authentication-failure-handler-ref</literal> - Can be used as an alternative to - authentication-failure-url, giving you full control over the - navigation flow after an authentication failure. The value should be he name of - an AuthenticationFailureHandler bean in the - application context. +
+ <literal><form-login></literal> Attributes +
+ <literal>always-use-default-target</literal> + If set to true, the user will always start at the value given by + default-target-url, regardless + of how they arrived at the login page. Maps to the alwaysUseDefaultTargetUrl + property of UsernamePasswordAuthenticationFilter. Default value is + false. +
+
+ <literal>authentication-details-source-ref</literal> + Reference to an AuthenticationDetailsSource which will be used + by the authentication filter +
+
+ <literal>authentication-failure-handler-ref</literal> + Can be used as an alternative to + authentication-failure-url, + giving you full control over the navigation flow after an authentication failure. The value + should be he name of an AuthenticationFailureHandler bean in the + application context. +
+
+ <literal>authentication-failure-url</literal> + Maps to the authenticationFailureUrl property of + UsernamePasswordAuthenticationFilter. Defines the URL the + browser will be redirected to on login failure. Defaults to + /spring_security_login?login_error, which will be automatically handled by + the automatic login page generator, re-rendering the login page with an error message. +
+
+ <literal>authentication-success-handler-ref</literal> + This can be used as an alternative to + default-target-url + and always-use-default-target, + giving you full control over the navigation flow after a successful authentication. The value + should be the name of an AuthenticationSuccessHandler bean in + the application context. By default, an implementation of + SavedRequestAwareAuthenticationSuccessHandler is used and + injected with the default-target-url + . +
+
+ <literal>default-target-url</literal> + Maps to the defaultTargetUrl property of + UsernamePasswordAuthenticationFilter. If not set, the + default value is "/" (the application root). A user will be taken to this URL + after logging in, provided they were not asked to login while attempting to + access a secured resource, when they will be taken to the originally requested + URL. +
+
+ <literal>login-page</literal> + The URL that should be used to render the login page. Maps to the + loginFormUrl property of the + LoginUrlAuthenticationEntryPoint. Defaults to + "/spring_security_login". +
+
+ <literal>login-processing-url</literal> + Maps to the filterProcessesUrl property of + UsernamePasswordAuthenticationFilter. The default value + is "/j_spring_security_check". +
+
+ <literal>password-parameter</literal> + The name of the request parameter which contains the password. Defaults to "j_password". +
+
+ <literal>username-parameter</literal> + The name of the request parameter which contains the username. Defaults to "j_username". +
- The <literal><http-basic></literal> Element - Adds a BasicAuthenticationFilter and + <literal><http-basic></literal> + Adds a BasicAuthenticationFilter and BasicAuthenticationEntryPoint to the configuration. The latter will only be used as the configuration entry point if form-based login is not - enabled. + enabled. +
+ Parent Elements of <literal><http-basic></literal> + + http + +
+
+ <literal><http-basic></literal> Attributes +
+ <literal>authentication-details-source-ref</literal> + Reference to an AuthenticationDetailsSource which will be used + by the authentication filter +
+
+ <literal>entry-point-ref</literal> + Sets the AuthenticationEntryPoint which is used by the + BasicAuthenticationFilter. +
+
+
+
+ <literal><http-firewall></literal> Element + This is a top-level element which can be used to inject a custom implementation of + HttpFirewall into the + FilterChainProxy created by the namespace. The default + implementation should be suitable for most applications. +
+ <literal><http-firewall></literal> Attributes +
+ <literal>ref</literal> + Defines a reference to a Spring bean that implements HttpFirewall. +
+
+
+
+ <literal><intercept-url></literal> + This element is used to define the set of URL patterns that the application is + interested in and to configure how they should be handled. It is used to construct + the FilterInvocationSecurityMetadataSource used by + the FilterSecurityInterceptor. It is also responsible for + configuring a ChannelAuthenticationFilter if particular URLs + need to be accessed by HTTPS, for example. When matching the specified patterns + against an incoming request, the matching is done in the order in which the elements + are declared. So the most specific matches patterns should come first and the most + general should come last. +
+ Parent Elements of <literal><intercept-url></literal> + + filter-invocation-definition-source + filter-security-metadata-source + http + +
+
+ <literal><intercept-url></literal> Attributes +
+ <literal>access</literal> + Lists the access attributes which will be stored in the + FilterInvocationSecurityMetadataSource for the + defined URL pattern/method combination. This should be a comma-separated list of + the security configuration attributes (such as role names). +
+
+ <literal>filters</literal> + Can only take the value none. This will cause any matching + request to bypass the Spring Security filter chain entirely. None of the rest of + the <http> configuration will have any effect on the + request and there will be no security context available for its duration. Access + to secured methods during the request will fail. +
+
+ <literal>method</literal> + The HTTP Method which will be used in combination with the pattern to match + an incoming request. If omitted, any method will match. If an identical pattern + is specified with and without a method, the method-specific match will take + precedence. +
+
+ <literal>pattern</literal> + The pattern which defines the URL path. The content will depend on the + request-matcher attribute from the containing http element, + so will default to ant path syntax. +
+
+ <literal>requires-channel</literal> + Can be http or https depending on whether a + particular URL pattern should be accessed over HTTP or HTTPS respectively. + Alternatively the value any can be used when there is no + preference. If this attribute is present on any + <intercept-url> element, then a + ChannelAuthenticationFilter will be added to the filter + stack and its additional dependencies added to the application + context. + If a <port-mappings> configuration is added, this + will be used to by the SecureChannelProcessor and + InsecureChannelProcessor beans to determine the ports + used for redirecting to HTTP/HTTPS. +
+
+
+
+ <literal><jee></literal> + Adds a J2eePreAuthenticatedProcessingFilter to the filter chain to provide integration with container + authentication. +
+ Parent Elements of <literal><jee></literal> + + http + +
+
+ <literal><jee></literal> Attributes +
+ <literal>mappable-roles</literal> + A comma-separate list of roles to look for in the incoming HttpServletRequest. +
+
+ <literal>user-service-ref</literal> + A reference to a user-service (or UserDetailsService bean) Id +
+
+
+
+ <literal><logout></literal> + Adds a LogoutFilter to the filter stack. This is + configured with a SecurityContextLogoutHandler. +
+ Parent Elements of <literal><logout></literal> + + http + +
+
+ <literal><logout></literal> Attributes +
+ The <literal>delete-cookies</literal> attribute + A comma-separated list of the names of cookies which should be deleted when the user logs out. + +
+
+ The <literal>invalidate-session</literal> attribute + Maps to the invalidateHttpSession of the + SecurityContextLogoutHandler. Defaults to "true", so the + session will be invalidated on logout. +
+
+ The <literal>logout-success-url</literal> attribute + The destination URL which the user will be taken to after logging out. + Defaults to "/". +
+
+ The <literal>logout-url</literal> attribute + The URL which will cause a logout (i.e. which will be processed by the + filter). Defaults to "/j_spring_security_logout". +
+
+ The <literal>success-handler-ref</literal> attribute + May be used to supply an instance of LogoutSuccessHandler + which will be invoked to control the navigation after logging out. + +
+
+
+
+ <literal><openid-login></literal> + Similar to <form-login> and has the same attributes. The + default value for login-processing-url is + "/j_spring_openid_security_check". An + OpenIDAuthenticationFilter and + OpenIDAuthenticationProvider will be registered. The latter + requires a reference to a UserDetailsService. Again, + this can be specified by id, using the user-service-ref + attribute, or will be located automatically in the application context. +
+ Parent Elements of <literal><openid-login></literal> + + http + +
+
+ <literal><openid-login></literal> Attributes +
+ <literal>always-use-default-target</literal> + Whether the user should always be redirected to the default-target-url after login. +
+
+ <literal>authentication-details-source-ref</literal> + Reference to an AuthenticationDetailsSource which will be used by the authentication filter +
+
+ <literal>authentication-failure-handler-ref</literal> + Reference to an AuthenticationFailureHandler bean which should be used to handle a failed + authentication request. Should not be used in combination with authentication-failure-url as the + implementation should always deal with navigation to the subsequent destination +
+
+ <literal>authentication-failure-url</literal> + The URL for the login failure page. If no login failure URL is specified, Spring Security will + automatically create a failure login URL at /spring_security_login?login_error and a corresponding + filter to render that login failure URL when requested. +
+
+ <literal>authentication-success-handler-ref</literal> + Reference to an AuthenticationSuccessHandler bean which should be used to handle a successful + authentication request. Should not be used in combination with + default-target-url (or + + always-use-default-target) as the implementation should always deal with navigation + to the subsequent destination +
+
+ <literal>default-target-url</literal> + The URL that will be redirected to after successful authentication, if the user's previous action + could not be resumed. This generally happens if the user visits a login page without having first requested a + secured operation that triggers authentication. If unspecified, defaults to the root of the application. +
+
+ <literal>login-page</literal> + The URL for the login page. If no login URL is specified, Spring Security will automatically + create a login URL at /spring_security_login and a corresponding filter to render that login URL when requested. + +
+
+ <literal>login-processing-url</literal> + The URL that the login form is posted to. If unspecified, it defaults to /j_spring_security_check. +
+
+ <literal>password-parameter</literal> + The name of the request parameter which contains the password. Defaults to "j_password". +
+
+ <literal>user-service-ref</literal> + A reference to a user-service (or UserDetailsService bean) Id +
+
+ <literal>username-parameter</literal> + The name of the request parameter which contains the username. Defaults to "j_username". +
+
+
+ Child Elements of <openid-login> + + attribute-exchange + +
+
+
+ <literal><attribute-exchange></literal> + The attribute-exchange element defines the list of + attributes which should be requested from the identity provider. An example can be found + in the OpenID Support section of the namespace configuration + chapter. More than one can be used, in which case each must have an identifier-match + attribute, containing a regular expression which is matched against the supplied + OpenID identifier. This allows different attribute lists to be fetched from + different providers (Google, Yahoo etc). +
+ Parent Elements of <literal><attribute-exchange></literal> + + openid-login + +
+
+ <literal><attribute-exchange></literal> Attributes +
+ <literal>identifier-match</literal> + A regular expression which will be compared against the claimed identity, when deciding which + attribute-exchange configuration to use during authentication. +
+
+
+ Child Elements of <literal><attribute-exchange></literal> + + openid-attribute + +
+
+
+ <literal><openid-attribute></literal> + Attributes used when making an OpenID AX + + Fetch Request +
+ Parent Elements of <literal><openid-attribute></literal> + + attribute-exchange + +
+
+ <literal><openid-attribute></literal> Attributes +
+ <literal>count</literal> + Specifies the number of attributes that you wish to get back. For example, return 3 emails. + The default value is 1. +
+
+ <literal>name</literal> + Specifies the name of the attribute that you wish to get back. For example, email. +
+
+ <literal>required</literal> + Specifies if this attribute is required to the OP, but does not error out if the OP does not + return the attribute. Default is false. +
+
+ <literal>type</literal> + Specifies the attribute type. For example, http://axschema.org/contact/email. See your OP's + documentation for valid attribute types. +
+
+
+
+ <literal><port-mappings></literal> + By default, an instance of PortMapperImpl will be added to + the configuration for use in redirecting to secure and insecure URLs. This element + can optionally be used to override the default mappings which that class defines. + Each child <port-mapping> element defines a pair of + HTTP:HTTPS ports. The default mappings are 80:443 and 8080:8443. An example of + overriding these can be found in the namespace introduction. +
+ Parent Elements of <literal><port-mappings></literal> + + http + +
+
+ Child Elements of <literal><port-mappings></literal> + + port-mapping + +
+
+
+ <literal><port-mapping></literal> + Provides a method to map http ports to https ports when forcing a redirect. +
+ Parent Elements of <literal><port-mapping></literal> + + port-mappings + +
+
+ <literal><port-mapping></literal> Attributes +
+ <literal>http</literal> + The http port to use. +
+
+ <literal>https</literal> + The https port to use. +
+
- The <literal><remember-me></literal> Element + <literal><remember-me></literal> Adds the RememberMeAuthenticationFilter to the stack. This in turn will be configured with either a TokenBasedRememberMeServices, a PersistentTokenBasedRememberMeServices or a user-specified bean implementing RememberMeServices depending on the attribute settings. -
- <literal>data-source-ref</literal> - If this is set, PersistentTokenBasedRememberMeServices - will be used and configured with a - JdbcTokenRepositoryImpl instance. +
+ Parent Elements of <literal><remember-me></literal> + + http +
-
- <literal>services-ref</literal> - Allows complete control of the - RememberMeServices implementation that will be - used by the filter. The value should be the id of a bean in the application - context which implements this interface. Should also implement - LogoutHandler if a logout filter is in use. -
-
- <literal>token-repository-ref</literal> - Configures a PersistentTokenBasedRememberMeServices - but allows the use of a custom - PersistentTokenRepository bean. -
-
- The <literal>key</literal> Attribute - Maps to the "key" property of - AbstractRememberMeServices. Should be set to a unique - value to ensure that remember-me cookies are only valid within the one - application - This doesn't affect the use of - PersistentTokenBasedRememberMeServices, where the - tokens are stored on the server side. - . -
-
- <literal>token-validity-seconds</literal> - Maps to the tokenValiditySeconds property of - AbstractRememberMeServices. Specifies the period in - seconds for which the remember-me cookie should be valid. By default it will be - valid for 14 days. -
-
- <literal>user-service-ref</literal> - The remember-me services implementations require access to a - UserDetailsService, so there has to be one - defined in the application context. If there is only one, it will be selected - and used automatically by the namespace configuration. If there are multiple - instances, you can specify a bean id explicitly using this attribute. -
-
- <literal>use-secure-cookie</literal> - It is recommended that remember-me cookies are only submitted over HTTPS and thus should - be flagged as secure. By default, a secure cookie will be used if the - connection over which the login request is made is secure (as it should be). - If you set this property to false, secure cookies will not be used. - Setting it to true will always set the secure flag on the cookie. - This attribute maps to the useSecureCookie property of - AbstractRememberMeServices. - -
-
- <literal>authentication-success-handler-ref</literal> - Sets the authenticationSuccessHandler property on the - RememberMeAuthenticationFilter if custom navigation is required. - The value should be the name of a AuthenticationSuccessHandler - bean in the application context. +
+ <literal><remember-me></literal> Attributes +
+ <literal>authentication-success-handler-ref</literal> + Sets the authenticationSuccessHandler property on the + RememberMeAuthenticationFilter if custom navigation is required. + The value should be the name of a AuthenticationSuccessHandler + bean in the application context. +
+
+ <literal>data-source-ref</literal> + A reference to a DataSource bean. If this is set, + PersistentTokenBasedRememberMeServices will be used and configured with a + JdbcTokenRepositoryImpl instance. +
+
+ <literal>key</literal> + Maps to the "key" property of + AbstractRememberMeServices. Should be set to a unique + value to ensure that remember-me cookies are only valid within the one + application + This doesn't affect the use of + PersistentTokenBasedRememberMeServices, where the + tokens are stored on the server side. + . If this is not set a secure random value will be generated. Since generating secure + random values can take a while, setting this value explicitly can help improve startup times when + using the remember me functionality. +
+
+ <literal>services-alias</literal> + Exports the internally defined RememberMeServices as a bean alias, + allowing it to be used by other beans in the application context. +
+
+ <literal>services-ref</literal> + Allows complete control of the + RememberMeServices implementation that will be + used by the filter. The value should be the id of a bean in the application + context which implements this interface. Should also implement + LogoutHandler if a logout filter is in use. +
+
+ <literal>token-repository-ref</literal> + Configures a PersistentTokenBasedRememberMeServices + but allows the use of a custom + PersistentTokenRepository bean. +
+
+ <literal>token-validity-seconds</literal> + Maps to the tokenValiditySeconds property of + AbstractRememberMeServices. Specifies the period in + seconds for which the remember-me cookie should be valid. By default it will be + valid for 14 days. +
+
+ <literal>use-secure-cookie</literal> + It is recommended that remember-me cookies are only submitted over HTTPS and thus should + be flagged as secure. By default, a secure cookie will be used if the + connection over which the login request is made is secure (as it should be). + If you set this property to false, secure cookies will not be used. + Setting it to true will always set the secure flag on the cookie. + This attribute maps to the useSecureCookie property of + AbstractRememberMeServices. + +
+
+ <literal>user-service-ref</literal> + The remember-me services implementations require access to a + UserDetailsService, so there has to be one + defined in the application context. If there is only one, it will be selected + and used automatically by the namespace configuration. If there are multiple + instances, you can specify a bean id explicitly using this attribute. +
-
- The <literal><session-management></literal> Element - Session-management related functionality is implemented by the addition of a +
+ <literal><request-cache></literal> Element + Sets the RequestCache instance which will be used + by the ExceptionTranslationFilter to store request + information before invoking an + AuthenticationEntryPoint. +
+ Parent Elements of <literal><request-cache></literal> + + http + +
+
+ <literal><request-cache></literal> Attributes +
+ <literal>ref</literal> + Defines a reference to a Spring bean that is a RequestCache. +
+
+
+
+ <literal><session-management></literal> + Session-management related functionality is implemented by the addition of a SessionManagementFilter to the filter stack. -
- <literal>session-fixation-protection</literal> - Indicates whether an existing session should be invalidated when a user - authenticates and a new session started. If set to "none" no change will be - made. "newSession" will create a new empty session. "migrateSession" will create - a new session and copy the session attributes to the new session. Defaults to - "migrateSession". - If session fixation protection is enabled, the - SessionManagementFilter is injected with an appropriately - configured DefaultSessionAuthenticationStrategy. See the - Javadoc for this class for more details. +
+ Parent Elements of <literal><session-management></literal> + + http +
-
- <literal>invalid-session-url</literal> - Setting this attribute will inject the SessionManagementFilter - with a SimpleRedirectInvalidSessionStrategy configured with - the attribute value. When an invalid session ID is submitted, the strategy will be invoked, - redirecting to the configured URL. - +
+ <literal><session-management></literal> Attributes +
+ <literal>invalid-session-url</literal> + Setting this attribute will inject the SessionManagementFilter + with a SimpleRedirectInvalidSessionStrategy configured with + the attribute value. When an invalid session ID is submitted, the strategy will be invoked, + redirecting to the configured URL. + +
+
+ <literal>session-authentication-error-url</literal> + Defines the URL of the error page which should be shown when the SessionAuthenticationStrategy + raises an exception. If not set, an unauthorized (402) error code will be returned to the client. + Note that this attribute doesn't apply if the error occurs during a form-based login, where the URL + for authentication failure will take precedence. +
+
+ <literal>session-authentication-strategy-ref</literal> + Allows injection of the SessionAuthenticationStrategy instance used by the + SessionManagementFilter +
+
+ <literal>session-fixation-protection</literal> + Indicates whether an existing session should be invalidated when a user + authenticates and a new session started. If set to "none" no change will be + made. "newSession" will create a new empty session. "migrateSession" will create + a new session and copy the session attributes to the new session. Defaults to + "migrateSession". + If session fixation protection is enabled, the + SessionManagementFilter is injected with an appropriately + configured DefaultSessionAuthenticationStrategy. See the + Javadoc for this class for more details. +
+
+
+ Child elements of <literal><session-management></literal> + + concurrency-control +
-
- The <literal><concurrency-control></literal> Element +
+ <literal><concurrency-control></literal> Adds support for concurrent session control, allowing limits to be placed on the number of active sessions a user can have. A ConcurrentSessionFilter will be created, and a @@ -425,143 +982,224 @@ SessionRegistry (a SessionRegistryImpl instance unless the user wishes to use a custom bean) will be created for use by the strategy. -
- The <literal>max-sessions</literal> attribute - Maps to the maximumSessions property of - ConcurrentSessionControlStrategy. +
+ Parent Elements of <literal><concurrency-control></literal> + + session-management +
-
- The <literal>expired-url</literal> attribute - The URL a user will be redirected to if they attempt to use a session which - has been "expired" by the concurrent session controller because the user has - exceeded the number of allowed sessions and has logged in again elsewhere. - Should be set unless exception-if-maximum-exceeded is set. If - no value is supplied, an expiry message will just be written directly back to - the response. +
+ <literal><concurrency-control></literal> Attributes +
+ <literal>error-if-maximum-exceeded</literal> + If set to "true" a + SessionAuthenticationException will be raised + when a user attempts to exceed the maximum allowed number of sessions. The + default behaviour is to expire the original session. +
+
+ <literal>expired-url</literal> + The URL a user will be redirected to if they attempt to use a session which + has been "expired" by the concurrent session controller because the user has + exceeded the number of allowed sessions and has logged in again elsewhere. + Should be set unless exception-if-maximum-exceeded is set. If + no value is supplied, an expiry message will just be written directly back to + the response. +
+
+ <literal>max-sessions</literal> + Maps to the maximumSessions property of + ConcurrentSessionControlStrategy. +
+
+ <literal>session-registry-alias</literal> + It can also be useful to have a reference to the internal session registry + for use in your own beans or an admin interface. You can expose the internal bean + using the session-registry-alias attribute, giving it a name + that you can use elsewhere in your configuration. +
+
+ <literal>session-registry-ref</literal> + The user can supply their own SessionRegistry + implementation using the session-registry-ref attribute. The + other concurrent session control beans will be wired up to use it. +
-
- The <literal>error-if-maximum-exceeded</literal> attribute - If set to "true" a - SessionAuthenticationException will be raised - when a user attempts to exceed the maximum allowed number of sessions. The - default behaviour is to expire the original session. -
-
- The <literal>session-registry-alias</literal> and - <literal>session-registry-ref</literal> attributes - The user can supply their own SessionRegistry - implementation using the session-registry-ref attribute. The - other concurrent session control beans will be wired up to use it. - It can also be useful to have a reference to the internal session registry - for use in your own beans or an admin interface. You can expose the interal bean - using the session-registry-alias attribute, giving it a name - that you can use elsewhere in your configuration. -
-
-
- The <literal><anonymous></literal> Element - Adds an AnonymousAuthenticationFilter to the stack and an - AnonymousAuthenticationProvider. Required if you are using - the IS_AUTHENTICATED_ANONYMOUSLY attribute.
- The <literal><x509></literal> Element + <literal><x509></literal> Adds support for X.509 authentication. An X509AuthenticationFilter will be added to the stack and an Http403ForbiddenEntryPoint bean will be created. The latter - will only be used if no other authentication mechanisms are in use (it's only + will only be used if no other authentication mechanisms are in use (its only functionality is to return an HTTP 403 error code). A PreAuthenticatedAuthenticationProvider will also be created which delegates the loading of user authorities to a UserDetailsService. -
- The <literal>subject-principal-regex</literal> attribute - Defines a regular expression which will be used to extract the username from - the certificate (for use with the - UserDetailsService). +
+ Parent Elements of <literal><x509></literal> + + http +
-
- The <literal>user-service-ref</literal> attribute - Allows a specific UserDetailsService to be - used with X.509 in the case where multiple instances are configured. If not set, - an attempt will be made to locate a suitable instance automatically and use - that. +
+ <literal><x509></literal> Attributes +
+ <literal>authentication-details-source-ref</literal> + A reference to an AuthenticationDetailsSource +
+
+ <literal>subject-principal-regex</literal> + Defines a regular expression which will be used to extract the username from + the certificate (for use with the + UserDetailsService). +
+
+ <literal>user-service-ref</literal> + Allows a specific UserDetailsService to be + used with X.509 in the case where multiple instances are configured. If not set, + an attempt will be made to locate a suitable instance automatically and use + that. +
-
- The <literal><openid-login></literal> Element - Similar to <form-login> and has the same attributes. The - default value for login-processing-url is - "/j_spring_openid_security_check". An - OpenIDAuthenticationFilter and - OpenIDAuthenticationProvider will be registered. The latter - requires a reference to a UserDetailsService. Again, - this can be specified by id, using the user-service-ref - attribute, or will be located automatically in the application context. -
- The <literal><attribute-exchange></literal> Element - The attribute-exchange element defines the list of - attributes which should be requested from the identity provider. More than one - can be used, in which case each must have an identifier-match - attribute, containing a regular expression which is matched against the supplied - OpenID identifer. This allows different attribute lists to be fetched from - different providers (Google, Yahoo etc). +
+ <literal><filter-chain-map></literal> + Used to explicitly configure a FilterChainProxy instance with a FilterChainMap +
+ <literal><filter-chain-map></literal> Attributes +
+ <literal>path-type</literal> + Superseded by the + request-matcher attribute +
+
+ <literal>request-matcher</literal> + Supersedes the 'path-type' attribute. Defines the strategy use for matching incoming requests. + Currently the options are 'ant' (for ant path patterns), 'regex' for regular expressions and 'ciRegex' for + case-insensitive regular expressions. +
+
+
+ Child Elements of <literal><filter-chain-map></literal> + + filter-chain +
-
- The <literal><logout></literal> Element - Adds a LogoutFilter to the filter stack. This is - configured with a SecurityContextLogoutHandler. -
- The <literal>logout-url</literal> attribute - The URL which will cause a logout (i.e. which will be processed by the - filter). Defaults to "/j_spring_security_logout". +
+ <literal><filter-chain></literal> + Used within to define a specific URL pattern and the list of filters which apply to the URLs matching + that pattern. When multiple filter-chain elements are assembled in a list in order to configure a FilterChainProxy, + the most specific patterns must be placed at the top of the list, with most general ones at the bottom. +
+ Parent Elements of <literal><filter-chain></literal> + + filter-chain-map +
-
- The <literal>logout-success-url</literal> attribute - The destination URL which the user will be taken to after logging out. - Defaults to "/". -
-
- The <literal>success-handler-ref</literal> attribute - May be used to supply an instance of LogoutSuccessHandler - which will be invoked to control the navigation after logging out. - -
-
- The <literal>invalidate-session</literal> attribute - Maps to the invalidateHttpSession of the - SecurityContextLogoutHandler. Defaults to "true", so the - session will be invalidated on logout. -
-
- The <literal>delete-cookies</literal> attribute - A comma-separated list of the names of cookies which should be deleted when the user logs out. - +
+ <literal><filter-chain></literal> Attributes +
+ <literal>filters</literal> + A comma separated list of references to Spring beans that implement + Filter. The value "none" means that no + Filter's should be used for this + FilterChain. +
+
+ <literal>pattern</literal> + A-pattern that creates RequestMatcher in combination with the + request-matcher +
+
+ <literal>request-matcher-ref</literal> + A reference to a RequestMatcher that will be used to determine if the + Filter's from the filters attribute should be invoked. +
-
- The <literal><custom-filter></literal> Element - This element is used to add a filter to the filter chain. It doesn't create any - additional beans but is used to select a bean of type - javax.servlet.Filter which is already defined in the - appllication context and add that at a particular position in the filter chain - maintained by Spring Security. Full details can be found in the namespace - chapter. +
+ <literal><filter-invocation-definition-source></literal> + Deprecated synonym for filter-security-metadata-source +
+ <literal><filter-invocation-definition-source></literal> Attributes +
+ <literal>id</literal> + A bean identifier, used for referring to the bean elsewhere in the context. +
+
+ <literal>lowercase-comparisons</literal> + Compare after forcing to lowercase +
+
+ <literal>path-type</literal> + Superseded by + request-matcher +
+
+ <literal>request-matcher</literal> + Supersedes the 'path-type' attribute. Defines the strategy use for matching incoming requests. + Currently the options are 'ant' (for ant path patterns), 'regex' for regular expressions and 'ciRegex' for + case-insensitive regular expressions. +
+
+ <literal>use-expressions</literal> + Enables the use of expressions in the 'access' attributes in <intercept-url> elements + rather than the traditional list of configuration attributes. Defaults to 'false'. If + enabled, each attribute should contain a single boolean expression. If the expression evaluates to 'true', access will be + granted. +
+
+
+ Child Elements of <literal><filter-invocation-definition-source></literal> + + intercept-url + +
-
- The <literal><request-cache></literal> Element - Sets the RequestCache instance which will be used - by the ExceptionTranslationFilter to store request - information before invoking an - AuthenticationEntryPoint. -
-
- The <literal><http-firewall></literal> Element - This is a top-level element which can be used to inject a custom implementation of - HttpFirewall into the - FilterChainProxy created by the namespace. The default - implementation should be suitable for most applications. +
+ <literal><filter-security-metadata-source></literal> + Used to explicitly configure a FilterSecurityMetadataSource bean for use with a FilterSecurityInterceptor. Usually + only needed if you are configuring a FilterChainProxy explicitly, rather than using the + <http> element. The intercept-url elements used should only contain pattern, method and access attributes. Any + others will result in a configuration error. +
+ <literal><filter-security-metadata-source></literal> Attributes +
+ <literal>id</literal> + A bean identifier, used for referring to the bean elsewhere in the context. +
+
+ <literal>lowercase-comparisons</literal> + Compare after forcing to lower case +
+
+ <literal>path-type</literal> + Superseded by + request-matcher + +
+
+ <literal>request-matcher</literal> + Supersedes the 'path-type' attribute. Defines the strategy use for matching incoming requests. + Currently the options are 'ant' (for ant path patterns), 'regex' for regular expressions and 'ciRegex' for + case-insensitive regular expressions. +
+
+ <literal>use-expressions</literal> + Enables the use of expressions in the 'access' attributes in + <intercept-url> elements rather than the traditional list of configuration attributes. Defaults to 'false'. If + enabled, each attribute should contain a single boolean expression. If the expression evaluates to 'true', + access will be granted. +
+
+
+ Child Elements of <literal><filter-security-metadata-source></literal> + + intercept-url + +
@@ -576,173 +1214,684 @@ definitions, marked for addition to the list using the authentication-provider element.
- The <literal><authentication-manager></literal> Element + <literal><authentication-manager></literal> Every Spring Security application which uses the namespace must have include this element somewhere. It is responsible for registering the AuthenticationManager which provides authentication - services to the application. It also allows you to define an alias name for the - internal instance for use in your own configuration. Its use is described in the - namespace introduction. All elements + services to the application. 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 - shorthand for configuring a DaoAuthenticationProvider. - DaoAuthenticationProvider loads user information from a - UserDetailsService and compares the - username/password combination with the values supplied at login. The - UserDetailsService instance can be defined either - by using an available namespace element (jdbc-user-service or - by using the user-service-ref attribute to point to a bean - defined elsewhere in the application context). You can find examples of these - variations in the namespace - introduction. -
- The <literal><password-encoder></literal> Element - Authentication providers can optionally be configured to use a password - encoder as described in the namespace introduction. This will result in the bean being injected - with the appropriate PasswordEncoder - instance, potentially with an accompanying - SaltSource bean to provide salt values for - hashing. +
+ <literal><authentication-manager></literal> Attributes +
+ <literal>alias</literal> + This attribute allows you to define an alias name for the + internal instance for use in your own configuration. Its use is described in the + namespace introduction. +
+
+ <literal>erase-credentials</literal> + If set to true, the AuthenticationManger will attempt to clear any credentials data in the + returned Authentication object, once the user has been authenticated. Literally it maps to + the eraseCredentialsAfterAuthentication property of the + ProviderManager. This is discussed in the Core Services chapter. +
+
+ <literal>id</literal> + This attribute allows you to define an id for the internal instance for use in your own + configuration. It is the same a the alias element, but provides a more consistent experience + with elements that use the id attribute.
-
- Using <literal><authentication-provider></literal> to refer to an - <interfacename>AuthenticationProvider</interfacename> Bean - If you have written your own - AuthenticationProvider implementation (or want to - configure one of Spring Security's own implementations as a traditional bean for - some reason, then you can use the following syntax to add it to the internal - ProviderManager's list: - - - - ]]> +
+ Child Elements of <literal><authentication-manager></literal> + + authentication-provider + ldap-authentication-provider + +
+
+
+ <literal><authentication-provider></literal> + Unless used with a ref attribute, this element is + shorthand for configuring a DaoAuthenticationProvider. + DaoAuthenticationProvider loads user information from a + UserDetailsService and compares the + username/password combination with the values supplied at login. The + UserDetailsService instance can be defined either + by using an available namespace element (jdbc-user-service or + by using the user-service-ref attribute to point to a bean + defined elsewhere in the application context). You can find examples of these + variations in the namespace + introduction. +
+ Parent Elements of <literal><authentication-provider></literal> + + authentication-manager + +
+
+ <literal><authentication-provider></literal> Attributes +
+ <literal>ref</literal> + Defines a reference to a Spring bean that implements AuthenticationProvider + . + If you have written your own + AuthenticationProvider implementation (or want to + configure one of Spring Security's own implementations as a traditional bean for + some reason, then you can use the following syntax to add it to the internal + ProviderManager's list: + + + + ]]> +
+
+ <literal>user-service-ref</literal> + A reference to a bean that implements UserDetailsService that may be created using the standard bean + element or the custom user-service element. +
+
+
+ Child Elements of <literal><authentication-provider></literal> + + jdbc-user-service + ldap-user-service + password-encoder + user-service + +
+
+
+ <literal><jdbc-user-service></literal> + Causes creation of a JDBC-based UserDetailsService. +
+ <literal><jdbc-user-service></literal> Attributes +
+ <literal>authorities-by-username-query</literal> + An SQL statement to query for a user's granted authorities given a username. + The default is + +
+
+ <literal>cache-ref</literal> + Defines a reference to a cache for use with a UserDetailsService. +
+
+ <literal>data-source-ref</literal> + The bean ID of the DataSource which provides the required tables. +
+
+ <literal>group-authorities-by-username-query</literal> + An SQL statement to query user's group authorities given a username. + The default is + +
+
+ <literal>id</literal> + A bean identifier, used for referring to the bean elsewhere in the context. +
+
+ <literal>role-prefix</literal> + A non-empty string prefix that will be added to role strings loaded from persistent + storage (default is "ROLE_"). Use the value "none" for no prefix in cases where the default is non-empty. +
+
+ <literal>users-by-username-query</literal> + An SQL statement to query a username, password, and enabled status given a username. + The default is + +
+
+
+
+ <literal><password-encoder></literal> + Authentication providers can optionally be configured to use a password + encoder as described in the namespace introduction. This will result in the bean being injected + with the appropriate PasswordEncoder + instance, potentially with an accompanying + SaltSource bean to provide salt values for + hashing. +
+ Parent Elements of <literal><password-encoder></literal> + + authentication-provider + password-compare + +
+
+ <literal><password-encoder></literal> Attributes +
+ <literal>base64</literal> + Whether a string should be base64 encoded +
+
+ <literal>hash</literal> + Defines the hashing algorithm used on user passwords. We recommend strongly against using + MD4, as it is a very weak hashing algorithm. +
+
+ <literal>ref</literal> + Defines a reference to a Spring bean that implements PasswordEncoder + . +
+
+
+ Child Elements of <literal><password-encoder></literal> + + salt-source + +
+
+
+ <literal><salt-source></literal> + Password salting strategy. A system-wide constant or a property from the UserDetails object + can be used. +
+ Parent Elements of <literal><salt-source></literal> + + password-encoder + +
+
+ <literal><salt-source></literal> Attributes +
+ <literal>ref</literal> + Defines a reference to a Spring bean Id. +
+
+ <literal>system-wide</literal> + A single value that will be used as the salt for a password encoder. +
+
+ <literal>user-property</literal> + A property of the UserDetails object which will be used as salt by a password encoder. + Typically something like "username" might be used. +
+
+
+
+ <literal><user-service></literal> + Creates an in-memory UserDetailsService from a properties file or a list of "user" child + elements. Usernames are converted to lower-case internally to allow for case-insensitive lookups, so + this should not be used if case-sensitivity is required. +
+ <literal><user-service></literal> Attributes +
+ <literal>id</literal> + A bean identifier, used for referring to the bean elsewhere in the context. +
+
+ <literal>properties</literal> + The location of a Properties file where each line is in the format of + +
+
+
+ Child Elements of <literal><user-service></literal> + + user + +
+
+
+ <literal><user></literal> + Represents a user in the application. +
+ Parent Elements of <literal><user></literal> + + user-service + +
+
+ <literal><user></literal> Attributes +
+ <literal>authorities</literal> + One of more authorities granted to the user. Separate authorities with a comma + (but no space). For example, "ROLE_USER,ROLE_ADMINISTRATOR" +
+
+ <literal>disabled</literal> + Can be set to "true" to mark an account as disabled and unusable. +
+
+ <literal>locked</literal> + Can be set to "true" to mark an account as locked and unusable. +
+
+ <literal>name</literal> + The username assigned to the user. +
+
+ <literal>password</literal> + The password assigned to the user. This may be hashed if the corresponding + authentication provider supports hashing (remember to set the "hash" attribute of the + "user-service" element). This attribute be omitted in the case where the data will + not be used for authentication, but only for accessing authorities. If omitted, the + namespace will generate a random value, preventing its accidental use for + authentication. Cannot be empty. +
Method Security -
- The <literal><global-method-security></literal> Element +
+ <literal><global-method-security></literal> This element is the primary means of adding support for securing methods on Spring Security beans. Methods can be secured by the use of annotations (defined at the interface or class level) or by defining a set of pointcuts as child elements, using AspectJ syntax. - Method security uses the same - AccessDecisionManager configuration as web security, - but this can be overridden as explained above , using the same attribute. -
- The <literal>secured-annotations</literal> and - <literal>jsr250-annotations</literal> Attributes - Setting these to "true" will enable support for Spring Security's own - @Secured annotations and JSR-250 annotations, respectively. - They are both disabled by default. Use of JSR-250 annotations also adds a - Jsr250Voter to the - AccessDecisionManager, so you need to make sure - you do this if you are using a custom implementation and want to use these - annotations. +
+ <literal><global-method-security></literal> Attributes +
+ <literal>access-decision-manager-ref</literal> + Method security uses the same AccessDecisionManager + configuration as web security, but this can be overridden using this attribute. By default + an AffirmativeBased implementation is used for with a RoleVoter and an AuthenticatedVoter. +
+
+ <literal>authentication-manager-ref</literal> + A reference to an AuthenticationManager + that should be used for method security. +
+
+ <literal>jsr250-annotations</literal> + Specifies whether JSR-250 style attributes are to be used (for example "RolesAllowed"). This + will require the javax.annotation.security classes on the classpath. Setting this to true also + adds a Jsr250Voter to the + AccessDecisionManager, so you need to make sure you do this if + you are using a custom implementation and want to use these annotations. +
+
+ <literal><metadata-source-ref></literal> Attribute + An external MethodSecurityMetadataSource + instance can be supplied which will take priority over other sources + (such as the default annotations). + +
+
+ The <literal>mode</literal> Attribute + This attribute can be set to aspectj to specify that AspectJ + should be used instead of the default Spring AOP. Secured methods must be woven + with the AnnotationSecurityAspect from the + spring-security-aspects module. +
+
+ <literal>order</literal> + Allows the advice "order" to be set for the method security interceptor. +
+
+ <literal>pre-post-annotations</literal> + Specifies whether the use of Spring Security's pre and post invocation annotations (@PreFilter, + @PreAuthorize, @PostFilter, @PostAuthorize) should be enabled for this application context. + Defaults to "disabled". +
+
+ <literal>proxy-target-class</literal> + If true, class based proxying will be used instead of interface based proxying. +
+
+ <literal>run-as-manager-ref</literal> + A reference to an optional RunAsManager implementation which + will be used by the configured MethodSecurityInterceptor +
+
+ <literal>secured-annotations</literal> + Specifies whether the use of Spring Security's @Secured annotations should be enabled for this + application context. Defaults to "disabled". +
-
- The <literal><metadata-source-ref></literal> Attribute - An external MethodSecurityMetadataSource - instance can be supplied which will take priority over other sources - (such as the default annotations). - -
-
- The <literal>mode</literal> Attribute - This attribute can be set to aspectj to specify that AspectJ - should be used instead of the default Spring AOP. Secured methods must be woven - with the AnnotationSecurityAspect from the - spring-security-aspects module. -
-
- Securing Methods using <literal><protect-pointcut></literal> - Rather than defining security attributes on an individual method or class - basis using the @Secured annotation, you can define - cross-cutting security constraints across whole sets of methods and interfaces - in your service layer using the <protect-pointcut> - element. This has two attributes: - - expression - the pointcut expression - - - access - the security attributes which apply - - You can find an example in the namespace introduction. -
-
- The <literal><after-invocation-provider></literal> Element - This element can be used to decorate an - AfterInvocationProvider for use by the security - interceptor maintained by the <global-method-security> - namespace. You can define zero or more of these within the - global-method-security element, each with a - ref attribute pointing to an - AfterInvocationProvider bean instance within your - application context. +
+ Child Elements of <literal><global-method-security></literal> + + after-invocation-provider + expression-handler + pre-post-annotation-handling + protect-pointcut +
-
- LDAP Namespace Options - LDAP is covered in some details in its own - chapter. We will expand on that here with some explanation of how the - namespace options map to Spring beans. The LDAP implementation uses Spring LDAP - extensively, so some familiarity with that project's API may be useful. -
- Defining the LDAP Server using the <literal><ldap-server></literal> - Element - This element sets up a Spring LDAP - ContextSource for use by the other LDAP beans, - defining the location of the LDAP server and other information (such as a - username and password, if it doesn't allow anonymous access) for connecting to - it. It can also be used to create an embedded server for testing. Details of the - syntax for both options are covered in the LDAP - chapter. The actual ContextSource - implementation is DefaultSpringSecurityContextSource - which extends Spring LDAP's LdapContextSource class. The - manager-dn and manager-password attributes - map to the latter's userDn and password - properties respectively. - If you only have one server defined in your application context, the other - LDAP namespace-defined beans will use it automatically. Otherwise, you can give - the element an "id" attribute and refer to it from other namespace beans using - the server-ref attribute. This is actually the bean id of the - ContextSource instance, if you want to use it in other - traditional Spring beans. +
+ <literal><after-invocation-provider></literal> + This element can be used to decorate an + AfterInvocationProvider for use by the security + interceptor maintained by the <global-method-security> + namespace. You can define zero or more of these within the + global-method-security element, each with a + ref attribute pointing to an + AfterInvocationProvider bean instance within your + application context. +
+ Parent Elements of <literal><after-invocation-provider></literal> + + global-method-security + +
+
+ <literal><after-invocation-provider></literal> Attributes +
+ <literal>ref</literal> + Defines a reference to a Spring bean that implements + AfterInvocationProvider. +
+
+
+
+ <literal><pre-post-annotation-handling></literal> + Allows the default expression-based mechanism for handling Spring Security's pre and post invocation + annotations (@PreFilter, @PreAuthorize, @PostFilter, @PostAuthorize) to be replace entirely. Only + applies if these annotations are enabled. +
+ Parent Elements of <literal><pre-post-annotation-handling></literal> + + global-method-security +
-
- The <literal><ldap-authentication-provider></literal> Element - This element is shorthand for the creation of an - LdapAuthenticationProvider instance. By default this will - be configured with a BindAuthenticator instance and a - DefaultAuthoritiesPopulator. As with all namespace - authentication providers, it must be included as a child of the - authentication-provider element. -
- The <literal>user-dn-pattern</literal> Attribute - If your users are at a fixed location in the directory (i.e. you can work +
+ Child Elements of <literal><pre-post-annotation-handling></literal> + + invocation-attribute-factory + post-invocation-advice + pre-invocation-advice + +
+
+
+ <literal><invocation-attribute-factory></literal> + Defines the PrePostInvocationAttributeFactory instance which is used to generate pre and post + invocation metadata from the annotated methods. +
+ Parent Elements of <literal><invocation-attribute-factory></literal> + + pre-post-annotation-handling + +
+
+ <literal><invocation-attribute-factory></literal> Attributes +
+ <literal>ref</literal> + Defines a reference to a Spring bean Id. +
+
+
+
+ <literal><post-invocation-advice></literal> + Customizes the PostInvocationAdviceProvider with the ref as the + PostInvocationAuthorizationAdvice for the <pre-post-annotation-handling> + element. +
+ Parent Elements of <literal><post-invocation-advice></literal> + + pre-post-annotation-handling + +
+
+ <literal><post-invocation-advice></literal> Attributes +
+ <literal>ref</literal> + Defines a reference to a Spring bean Id. +
+
+
+
+ <literal><pre-invocation-advice></literal> + Customizes the PreInvocationAuthorizationAdviceVoter with the ref as the + PreInvocationAuthorizationAdviceVoter for the + <pre-post-annotation-handling> element. +
+ Parent Elements of <literal><pre-invocation-advice></literal> + + pre-post-annotation-handling + +
+
+ <literal><pre-invocation-advice></literal> Attributes +
+ <literal>ref</literal> + Defines a reference to a Spring bean Id. +
+
+
+
+ Securing Methods using <literal><protect-pointcut></literal> + Rather than defining security attributes on an individual method or class + basis using the @Secured annotation, you can define + cross-cutting security constraints across whole sets of methods and interfaces + in your service layer using the <protect-pointcut> + element. You can find an example in the namespace introduction. +
+ Parent Elements of <literal><protect-pointcut></literal> + + global-method-security + +
+
+ <literal><protect-pointcut></literal> Attributes +
+ <literal>access</literal> + Access configuration attributes list that applies to all methods matching the pointcut, + e.g. "ROLE_A,ROLE_B" +
+
+ <literal>expression</literal> + An AspectJ expression, including the 'execution' keyword. For example, 'execution(int + com.foo.TargetObject.countLength(String))' (without the quotes). +
+
+
+
+ <literal><intercept-methods></literal> + Can be used inside a bean definition to add a security interceptor to the bean and set up access + configuration attributes for the bean's methods +
+ <literal><intercept-methods></literal> Attributes +
+ <literal>access-decision-manager-ref</literal> + Optional AccessDecisionManager bean ID to be used by the created method security interceptor. +
+
+
+ Child Elements of <literal><intercept-methods></literal> + + protect + +
+
+
+ <literal><method-security-metadata-source></literal> + Creates a MethodSecurityMetadataSource instance +
+ <literal><method-security-metadata-source></literal> Attributes +
+ <literal>id</literal> + A bean identifier, used for referring to the bean elsewhere in the context. +
+
+ <literal>use-expressions</literal> + Enables the use of expressions in the 'access' attributes in + <intercept-url> elements rather than the traditional list of configuration attributes. + Defaults to 'false'. If enabled, each attribute should contain a single boolean expression. + If the expression evaluates to 'true', access will be granted. +
+
+
+ Child Elements of <literal><method-security-metadata-source></literal> + + protect + +
+
+
+ <literal><protect></literal> + Defines a protected method and the access control configuration attributes that apply to it. We + strongly advise you NOT to mix "protect" declarations with any services provided "global-method-security". +
+ Parent Elements of <literal><protect></literal> + + intercept-methods + method-security-metadata-source + +
+
+ <literal><protect></literal> Attributes +
+ <literal>access</literal> + Access configuration attributes list that applies to the method, e.g. "ROLE_A,ROLE_B". +
+
+ <literal>method</literal> + A method name +
+
+
+
+
+ LDAP Namespace Options + LDAP is covered in some details in its own + chapter. We will expand on that here with some explanation of how the + namespace options map to Spring beans. The LDAP implementation uses Spring LDAP + extensively, so some familiarity with that project's API may be useful. +
+ Defining the LDAP Server using the <literal><ldap-server></literal> + Element + This element sets up a Spring LDAP + ContextSource for use by the other LDAP beans, + defining the location of the LDAP server and other information (such as a + username and password, if it doesn't allow anonymous access) for connecting to + it. It can also be used to create an embedded server for testing. Details of the + syntax for both options are covered in the LDAP + chapter. The actual ContextSource + implementation is DefaultSpringSecurityContextSource + which extends Spring LDAP's LdapContextSource class. The + manager-dn and manager-password attributes + map to the latter's userDn and password + properties respectively. + If you only have one server defined in your application context, the other + LDAP namespace-defined beans will use it automatically. Otherwise, you can give + the element an "id" attribute and refer to it from other namespace beans using + the server-ref attribute. This is actually the bean id of the + ContextSource instance, if you want to use it in other + traditional Spring beans. +
+ <literal><ldap-server></literal> Attributes +
+ <literal>id</literal> + A bean identifier, used for referring to the bean elsewhere in the context. +
+
+ <literal>ldif</literal> + Explicitly specifies an ldif file resource to load into an embedded LDAP server. The ldiff + is should be a Spring resource pattern (i.e. classpath:init.ldiff). The default is + classpath*:*.ldiff +
+
+ <literal>manager-dn</literal> + Username (DN) of the "manager" user identity which will be used to authenticate to a + (non-embedded) LDAP server. If omitted, anonymous access will be used. +
+
+ <literal>manager-password</literal> + The password for the manager DN. This is required if the manager-dn is specified. +
+
+ <literal>port</literal> + Specifies an IP port number. Used to configure an embedded LDAP server, for example. The + default value is 33389. +
+
+ <literal>root</literal> + Optional root suffix for the embedded LDAP server. Default is "dc=springframework,dc=org" + +
+
+ <literal>url</literal> + Specifies the ldap server URL when not using the embedded LDAP server. +
+
+
+
+ <literal><ldap-authentication-provider></literal> + This element is shorthand for the creation of an + LdapAuthenticationProvider instance. By default this will + be configured with a BindAuthenticator instance and a + DefaultAuthoritiesPopulator. As with all namespace + authentication providers, it must be included as a child of the + authentication-provider element. +
+ Parent Elements of <literal><ldap-authentication-provider></literal> + + authentication-manager + +
+
+ <literal><ldap-authentication-provider></literal> Attributes +
+ <literal>group-role-attribute</literal> + The LDAP attribute name which contains the role name which will be used within Spring + Security. Maps to the DefaultLdapAuthoritiesPopulator's + groupRoleAttribute property. Defaults to "cn". +
+
+ <literal>group-search-base</literal> + Search base for group membership searches. Maps to the + DefaultLdapAuthoritiesPopulator's groupSearchBase + constructor argument. Defaults to "" (searching from the root). +
+
+ <literal>group-search-filter</literal> + Group search filter. Maps to the DefaultLdapAuthoritiesPopulator's + groupSearchFilter property. Defaults to (uniqueMember={0}). + The substituted parameter is the DN of the user. +
+
+ <literal>role-prefix</literal> + A non-empty string prefix that will be added to role strings loaded from persistent. + Maps to the DefaultLdapAuthoritiesPopulator's + rolePrefix property. Defaults to "ROLE_". Use the value "none" for + no prefix in cases where the default is non-empty. +
+
+ <literal>server-ref</literal> + The optional server to use. If omitted, and a default LDAP server is registered (using + <ldap-server> with no Id), that server will be used. +
+
+ <literal>user-context-mapper-ref</literal> + Allows explicit customization of the loaded user object by specifying a + UserDetailsContextMapper bean which will be called with the context information + from the user's directory entry +
+
+ <literal>user-details-class</literal> + Allows the objectClass of the user entry to be specified. If set, the framework will + attempt to load standard attributes for the defined class into the returned UserDetails + object +
+
+ <literal>user-dn-pattern</literal> + If your users are at a fixed location in the directory (i.e. you can work out the DN directly from the username without doing a directory search), you can use this attribute to map directly to the DN. It maps directly to the userDnPatterns property of - AbstractLdapAuthenticator. + AbstractLdapAuthenticator. The value is a specific pattern + used to build the user's DN, for example "uid={0},ou=people". The key + "{0}" must be present and will be substituted with the username.
-
- The <literal>user-search-base</literal> and - <literal>user-search-filter</literal> Attributes - If you need to perform a search to locate the user in the directory, then +
+ <literal>user-search-base</literal> + Search base for user searches. Defaults to "". Only used with a 'user-search-filter'. + If you need to perform a search to locate the user in the directory, then you can set these attributes to control the search. The BindAuthenticator will be configured with a FilterBasedLdapUserSearch and the attribute values @@ -752,40 +1901,124 @@ user-search-filter="(uid={0})" and user-search-base="" will be used.
-
- <literal>group-search-filter</literal>, - <literal>group-search-base</literal>, - <literal>group-role-attribute</literal> and <literal>role-prefix</literal> - Attributes - The value of group-search-base is mapped to the - groupSearchBase constructor argument of - DefaultAuthoritiesPopulator and defaults to - "ou=groups". The default filter value is "(uniqueMember={0})", which assumes - that the entry is of type "groupOfUniqueNames". - group-role-attribute maps to the - groupRoleAttribute attribute and defaults to "cn". - Similarly role-prefix maps to - rolePrefix and defaults to "ROLE_". -
-
- The <literal><password-compare></literal> Element - This is used as child element to <ldap-provider> - and switches the authentication strategy from - BindAuthenticator to - PasswordComparisonAuthenticator. This can optionally - be supplied with a hash attribute or with a child - <password-encoder> element to hash the password - before submitting it to the directory for comparison. +
+ <literal>user-search-filter</literal> + The LDAP filter used to search for users (optional). For example "(uid={0})". The + substituted parameter is the user's login name. + If you need to perform a search to locate the user in the directory, then + you can set these attributes to control the search. The + BindAuthenticator will be configured with a + FilterBasedLdapUserSearch and the attribute values + map directly to the first two arguments of that bean's constructor. If these + attributes aren't set and no user-dn-pattern has been + supplied as an alternative, then the default search values of + user-search-filter="(uid={0})" and + user-search-base="" will be used.
-
- The <literal><ldap-user-service></literal> Element - This element configures an LDAP - UserDetailsService. The class used is - LdapUserDetailsService which is a combination of a - FilterBasedLdapUserSearch and a - DefaultAuthoritiesPopulator. The attributes it supports - have the same usage as in <ldap-provider>. +
+ Child Elements of <literal><ldap-authentication-provider></literal> + + password-compare + +
+
+
+ <literal><password-compare></literal> + This is used as child element to <ldap-provider> + and switches the authentication strategy from + BindAuthenticator to + PasswordComparisonAuthenticator. +
+ Parent Elements of <literal><password-compare></literal> + + ldap-authentication-provider + +
+
+ <literal><password-compare></literal> Attributes +
+ <literal>hash</literal> + Defines the hashing algorithm used on user passwords. We recommend strongly against + using MD4, as it is a very weak hashing algorithm. +
+
+ <literal>password-attribute</literal> + The attribute in the directory which contains the user password. Defaults to "userPassword". + +
+
+
+ Child Elements of <literal><password-compare></literal> + + password-encoder + +
+
+
+ <literal><ldap-user-service></literal> + This element configures an LDAP + UserDetailsService. The class used is + LdapUserDetailsService which is a combination of a + FilterBasedLdapUserSearch and a + DefaultLdapAuthoritiesPopulator. The attributes it supports + have the same usage as in <ldap-provider>. +
+ <literal><ldap-user-service></literal> Attributes +
+ <literal>cache-ref</literal> + Defines a reference to a cache for use with a UserDetailsService. +
+
+ <literal>group-role-attribute</literal> + The LDAP attribute name which contains the role name which will be used within Spring + Security. Defaults to "cn". +
+
+ <literal>group-search-base</literal> + Search base for group membership searches. Defaults to "" (searching from the root). +
+
+ <literal>group-search-filter</literal> + Group search filter. Defaults to (uniqueMember={0}). The substituted parameter is the DN of + the user. +
+
+ <literal>id</literal> + A bean identifier, used for referring to the bean elsewhere in the context. +
+
+ <literal>role-prefix</literal> + A non-empty string prefix that will be added to role strings loaded from persistent + storage (e.g. "ROLE_"). Use the value "none" for no prefix in cases where the default is + non-empty. +
+
+ <literal>server-ref</literal> + The optional server to use. If omitted, and a default LDAP server is registered (using + <ldap-server> with no Id), that server will be used. +
+
+ <literal>user-context-mapper-ref</literal> + Allows explicit customization of the loaded user object by specifying a + UserDetailsContextMapper bean which will be called with the context information from the + user's directory entry +
+
+ <literal>user-details-class</literal> + Allows the objectClass of the user entry to be specified. If set, the framework will + attempt to load standard attributes for the defined class into the returned UserDetails object + +
+
+ <literal>user-search-base</literal> + Search base for user searches. Defaults to "". Only used with a 'user-search-filter'. +
+
+ <literal>user-search-filter</literal> + The LDAP filter used to search for users (optional). For example "(uid={0})". The + substituted parameter is the user's login name. +
diff --git a/docs/manual/src/docbook/jaas-auth-provider.xml b/docs/manual/src/docbook/jaas-auth-provider.xml index 4a97bd48c5..47947ac71d 100644 --- a/docs/manual/src/docbook/jaas-auth-provider.xml +++ b/docs/manual/src/docbook/jaas-auth-provider.xml @@ -225,7 +225,7 @@ JAASTest { Subject subject = Subject.getSubject(AccessController.getContext()); ]]> This integration can easily be configured using the - jaas-api-provision attribute. This + jaas-api-provision attribute. This feature is useful when integrating with legacy or external API's that rely on the JAAS Subject being populated.
diff --git a/docs/manual/src/docbook/samples.xml b/docs/manual/src/docbook/samples.xml index 6761697242..79e2c4f53d 100644 --- a/docs/manual/src/docbook/samples.xml +++ b/docs/manual/src/docbook/samples.xml @@ -132,7 +132,7 @@ Success! Your web filters appear to be properly configured! The JAAS sample is very simple example of how to use a JAAS LoginModule with Spring Security. The provided LoginModule will successfully authenticate a user if the username equals the password otherwise a LoginException is thrown. The AuthorityGranter used in this example always grants the role ROLE_USER. The sample application also demonstrates how to run as the JAAS Subject - returned by the LoginModule by setting jaas-api-provision equal to "true". + returned by the LoginModule by setting jaas-api-provision equal to "true".
Pre-Authentication Sample