mirror of
				https://github.com/spring-projects/spring-security.git
				synced 2025-10-30 22:28:46 +00:00 
			
		
		
		
	Corrected references to old context class names in Javadoc and logging.
This commit is contained in:
		
							parent
							
								
									5a51f391a4
								
							
						
					
					
						commit
						5cb7575b2b
					
				| @ -17,8 +17,7 @@ package net.sf.acegisecurity; | |||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Thrown if an authentication request is rejected because there is no {@link |  * Thrown if an authentication request is rejected because there is no {@link | ||||||
|  * Authentication} object in the  {@link |  * Authentication} object in the  {@link net.sf.acegisecurity.context.SecurityContext SecurityContext}. | ||||||
|  * net.sf.acegisecurity.context.security.SecureContext}. |  | ||||||
|  * |  * | ||||||
|  * @author Ben Alex |  * @author Ben Alex | ||||||
|  * @version $Id$ |  * @version $Id$ | ||||||
|  | |||||||
| @ -19,18 +19,18 @@ package net.sf.acegisecurity; | |||||||
|  * Creates a new temporary {@link Authentication} object for the current secure |  * Creates a new temporary {@link Authentication} object for the current secure | ||||||
|  * object invocation only. |  * object invocation only. | ||||||
|  *  |  *  | ||||||
|  * <P> |  * <p> | ||||||
|  * This interface permits implementations to replace the |  * This interface permits implementations to replace the | ||||||
|  * <code>Authentication</code> object that applies to the current secure |  * <code>Authentication</code> object that applies to the current secure | ||||||
|  * object invocation only. The {@link |  * object invocation only. The {@link | ||||||
|  * net.sf.acegisecurity.intercept.AbstractSecurityInterceptor} will replace |  * net.sf.acegisecurity.intercept.AbstractSecurityInterceptor} will replace | ||||||
|  * the <code>Authentication</code> object held in the  {@link |  * the <code>Authentication</code> object held in the | ||||||
|  * net.sf.acegisecurity.context.security.SecureContext} for the duration of |  * {@link net.sf.acegisecurity.context.SecurityContext SecurityContext} | ||||||
|  * the secure object callback only, returning it to the original |  * for the duration of  the secure object callback only, returning it to | ||||||
|  * <code>Authentication</code> object when the callback ends. |  * the original <code>Authentication</code> object when the callback ends. | ||||||
|  * </p> |  * </p> | ||||||
|  *  |  *  | ||||||
|  * <P> |  * <p> | ||||||
|  * This is provided so that systems with two layers of objects can be |  * This is provided so that systems with two layers of objects can be | ||||||
|  * established. One layer is public facing and has normal secure methods with |  * established. One layer is public facing and has normal secure methods with | ||||||
|  * the granted authorities expected to be held by external callers. The other |  * the granted authorities expected to be held by external callers. The other | ||||||
|  | |||||||
| @ -34,7 +34,7 @@ import javax.servlet.http.HttpSession; | |||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * <p> |  * <p> | ||||||
|  * Populates the <code>SecurityContextHolder</code> with information obtained |  * Populates the {@link SecurityContextHolder}</code> with information obtained | ||||||
|  * from the <code>HttpSession</code>. |  * from the <code>HttpSession</code>. | ||||||
|  * </p> |  * </p> | ||||||
|  *  |  *  | ||||||
| @ -60,15 +60,15 @@ import javax.servlet.http.HttpSession; | |||||||
|  * No <code>HttpSession</code> will be created by this filter if one does not |  * No <code>HttpSession</code> will be created by this filter if one does not | ||||||
|  * already exist. If at the end of the web request the |  * already exist. If at the end of the web request the | ||||||
|  * <code>HttpSession</code> does not exist, a <code>HttpSession</code> will |  * <code>HttpSession</code> does not exist, a <code>HttpSession</code> will | ||||||
|  * <b>only</b> be created if the current contents of |  * <b>only</b> be created if the current contents of the | ||||||
|  * <code>ContextHolder</code> are not {@link |  * <code>SecurityContextHolder</code> are not {@link | ||||||
|  * java.lang.Object#equals(java.lang.Object)} to a <code>new</code> instance |  * java.lang.Object#equals(java.lang.Object)} to a <code>new</code> instance | ||||||
|  * of {@link #setContext(Class)}. This avoids needless |  * of {@link #setContext(Class)}. This avoids needless | ||||||
|  * <code>HttpSession</code> creation, but automates the storage of changes |  * <code>HttpSession</code> creation, but automates the storage of changes | ||||||
|  * made to the <code>ContextHolder</code>. |  * made to the <code>SecurityContextHolder</code>. | ||||||
|  * </p> |  * </p> | ||||||
|  *  |  *  | ||||||
|  * <P> |  * <p> | ||||||
|  * This filter will only execute once per request, to resolve servlet container |  * This filter will only execute once per request, to resolve servlet container | ||||||
|  * (specifically Weblogic) incompatibilities. |  * (specifically Weblogic) incompatibilities. | ||||||
|  * </p> |  * </p> | ||||||
| @ -79,16 +79,16 @@ import javax.servlet.http.HttpSession; | |||||||
|  * similar clients that will never present the same <code>jsessionid</code> |  * similar clients that will never present the same <code>jsessionid</code> | ||||||
|  * etc), the  {@link #setAllowSessionCreation(boolean)} should be set to |  * etc), the  {@link #setAllowSessionCreation(boolean)} should be set to | ||||||
|  * <code>false</code>. Only do this if you really need to conserve server |  * <code>false</code>. Only do this if you really need to conserve server | ||||||
|  * memory and ensure all classes using the <code>ContextHolder</code> are |  * memory and ensure all classes using the <code>SecurityContextHolder</code> are | ||||||
|  * designed to have no persistence of the <code>Context</code> between web |  * designed to have no persistence of the <code>SecurityContext</code> between web | ||||||
|  * requests. |  * requests. | ||||||
|  * </p> |  * </p> | ||||||
|  *  |  *  | ||||||
|  * <p> |  * <p> | ||||||
|  * This filter MUST be executed BEFORE any authentication procesing mechanisms. |  * This filter MUST be executed BEFORE any authentication procesing mechanisms. | ||||||
|  * Authentication processing mechanisms (eg BASIC, CAS processing filters etc) |  * Authentication processing mechanisms (eg BASIC, CAS processing filters etc) | ||||||
|  * expect the <code>ContextHolder</code> to contain a valid |  * expect the <code>SecurityContextHolder</code> to contain a valid | ||||||
|  * <code>SecureContext</code> by the time they execute. |  * <code>SecurityContext</code> by the time they execute. | ||||||
|  * </p> |  * </p> | ||||||
|  * |  * | ||||||
|  * @author Ben Alex |  * @author Ben Alex | ||||||
|  | |||||||
| @ -25,7 +25,7 @@ import java.io.Serializable; | |||||||
|  * current thread of execution. |  * current thread of execution. | ||||||
|  *  |  *  | ||||||
|  * <p> |  * <p> | ||||||
|  * Stored in {@link net.sf.acegisecurity.context.SecurityContextHolder}. |  * The security context is stored in a {@link SecurityContextHolder}. | ||||||
|  * </p> |  * </p> | ||||||
|  * |  * | ||||||
|  * @author Ben Alex |  * @author Ben Alex | ||||||
|  | |||||||
| @ -20,10 +20,10 @@ import org.springframework.util.Assert; | |||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Associates a given {@link SecurityContext} with the current execution |  * Associates a given {@link SecurityContext} with the current execution | ||||||
|  * thread, along with new threads the current execution thread may spawn. |  * thread and any new threads the current execution thread may spawn. | ||||||
|  *  |  *  | ||||||
|  * <p> |  * <p> | ||||||
|  * To guarantee the {@link #getContext()} never returns <code>null</code>, this |  * To guarantee that {@link #getContext()} never returns <code>null</code>, this | ||||||
|  * class defaults to returning <code>SecurityContextImpl</code> if no |  * class defaults to returning <code>SecurityContextImpl</code> if no | ||||||
|  * <code>SecurityContext</code> has ever been associated with the current |  * <code>SecurityContext</code> has ever been associated with the current | ||||||
|  * thread of execution. Despite this behaviour, in general another class will |  * thread of execution. Despite this behaviour, in general another class will | ||||||
|  | |||||||
| @ -21,9 +21,7 @@ import net.sf.acegisecurity.Authentication; | |||||||
|  * Base implementation of {@link SecurityContext}. |  * Base implementation of {@link SecurityContext}. | ||||||
|  * |  * | ||||||
|  * <p> |  * <p> | ||||||
|  * Used by default by {@link |  * Used by default by {@link SecurityContextHolder} and {@link HttpSessionContextIntegrationFilter}. | ||||||
|  * net.sf.acegisecurity.context.SecurityContextHolder} and {@link |  | ||||||
|  * net.sf.acegisecurity.context.HttpSessionContextIntegrationFilter}. |  | ||||||
|  * </p> |  * </p> | ||||||
|  * |  * | ||||||
|  * @author Ben Alex |  * @author Ben Alex | ||||||
|  | |||||||
| @ -61,14 +61,14 @@ public class AuthenticationSimpleHttpInvokerRequestExecutor | |||||||
|     /** |     /** | ||||||
|      * Called every time a HTTP invocation is made. |      * Called every time a HTTP invocation is made. | ||||||
|      *  |      *  | ||||||
|      * <P> |      * <p> | ||||||
|      * Simply allows the parent to setup the connection, and then adds an |      * Simply allows the parent to setup the connection, and then adds an | ||||||
|      * <code>Authorization</code> HTTP header property that will be used for |      * <code>Authorization</code> HTTP header property that will be used for | ||||||
|      * BASIC authentication. |      * BASIC authentication. | ||||||
|      * </p> |      * </p> | ||||||
|      *  |      *  | ||||||
|      * <P> |      * <p> | ||||||
|      * The <code>ContextHolder</code> is used to obtain the relevant principal |      * The <code>SecurityContextHolder</code> is used to obtain the relevant principal | ||||||
|      * and credentials. |      * and credentials. | ||||||
|      * </p> |      * </p> | ||||||
|      * |      * | ||||||
| @ -77,7 +77,7 @@ public class AuthenticationSimpleHttpInvokerRequestExecutor | |||||||
|      * |      * | ||||||
|      * @throws IOException if thrown by HttpURLConnection methods |      * @throws IOException if thrown by HttpURLConnection methods | ||||||
|      * @throws AuthenticationCredentialsNotFoundException if the |      * @throws AuthenticationCredentialsNotFoundException if the | ||||||
|      *         <code>ContextHolder</code> does not contain a valid |      *         <code>SecurityContextHolder</code> does not contain a valid | ||||||
|      *         <code>Authentication</code> with both its |      *         <code>Authentication</code> with both its | ||||||
|      *         <code>principal</code> and <code>credentials</code> not |      *         <code>principal</code> and <code>credentials</code> not | ||||||
|      *         <code>null</code> |      *         <code>null</code> | ||||||
|  | |||||||
| @ -32,7 +32,7 @@ import java.lang.reflect.InvocationTargetException; | |||||||
| /** | /** | ||||||
|  * The actual <code>RemoteInvocation</code> that is passed from the client to |  * The actual <code>RemoteInvocation</code> that is passed from the client to | ||||||
|  * the server, which contains the contents of {@link SecurityContextHolder}, |  * the server, which contains the contents of {@link SecurityContextHolder}, | ||||||
|  * being a {@link SecureContext} object. |  * being a {@link SecurityContext} object. | ||||||
|  *  |  *  | ||||||
|  * <p> |  * <p> | ||||||
|  * When constructed on the client via {@link |  * When constructed on the client via {@link | ||||||
|  | |||||||
| @ -22,7 +22,7 @@ import net.sf.acegisecurity.ConfigAttributeDefinition; | |||||||
| /** | /** | ||||||
|  * Indicates a secure object invocation failed because the |  * Indicates a secure object invocation failed because the | ||||||
|  * <code>Authentication</code> could not be obtained from the |  * <code>Authentication</code> could not be obtained from the | ||||||
|  * <code>ContextHolder</code>. |  * <code>SecurityContextHolder</code>. | ||||||
|  * |  * | ||||||
|  * @author Ben Alex |  * @author Ben Alex | ||||||
|  * @version $Id$ |  * @version $Id$ | ||||||
|  | |||||||
| @ -41,11 +41,11 @@ public class AuthorizationFailureEvent extends AbstractAuthorizationEvent { | |||||||
|      * |      * | ||||||
|      * @param secureObject the secure object |      * @param secureObject the secure object | ||||||
|      * @param configAttribs that apply to the secure object |      * @param configAttribs that apply to the secure object | ||||||
|      * @param authentication that was found on the <code>ContextHolder</code> |      * @param authentication that was found in the <code>SecurityContextHolder</code> | ||||||
|      * @param accessDeniedException that was returned by the |      * @param accessDeniedException that was returned by the | ||||||
|      *        <code>AccessDecisionManager</code> |      *        <code>AccessDecisionManager</code> | ||||||
|      * |      * | ||||||
|      * @throws IllegalArgumentException DOCUMENT ME! |      * @throws IllegalArgumentException if any null arguments are presented. | ||||||
|      */ |      */ | ||||||
|     public AuthorizationFailureEvent(Object secureObject, |     public AuthorizationFailureEvent(Object secureObject, | ||||||
|         ConfigAttributeDefinition configAttribs, Authentication authentication, |         ConfigAttributeDefinition configAttribs, Authentication authentication, | ||||||
|  | |||||||
| @ -18,14 +18,14 @@ package net.sf.acegisecurity.event.authorization; | |||||||
| /** | /** | ||||||
|  * Event that is generated whenever a public secure object is invoked. |  * Event that is generated whenever a public secure object is invoked. | ||||||
|  *  |  *  | ||||||
|  * <P> |  * <p> | ||||||
|  * A public secure object is a secure object that has no |  * A public secure object is a secure object that has no | ||||||
|  * <code>ConfigAttributeDefinition</code> defined. A public secure object will |  * <code>ConfigAttributeDefinition</code> defined. A public secure object will | ||||||
|  * not cause the <code>ContextHolder</code> to be inspected or authenticated, |  * not cause the <code>SecurityContextHolder</code> to be inspected or authenticated, | ||||||
|  * and no authorization will take place. |  * and no authorization will take place. | ||||||
|  * </p> |  * </p> | ||||||
|  *  |  *  | ||||||
|  * <P> |  * <p> | ||||||
|  * Published just before the secure object attempts to proceed. |  * Published just before the secure object attempts to proceed. | ||||||
|  * </p> |  * </p> | ||||||
|  * |  * | ||||||
|  | |||||||
| @ -39,8 +39,8 @@ import javax.servlet.ServletResponse; | |||||||
|  * Detects if there is no <code>Authentication</code> object in the |  * Detects if there is no <code>Authentication</code> object in the | ||||||
|  * <code>SecurityContextHolder</code>,  and populates it with one if needed. |  * <code>SecurityContextHolder</code>,  and populates it with one if needed. | ||||||
|  * |  * | ||||||
|  * <P> |  * <p> | ||||||
|  * <B>Do not use this class directly.</B> Instead configure |  * <b>Do not use this class directly.</b> Instead configure | ||||||
|  * <code>web.xml</code> to use the {@link |  * <code>web.xml</code> to use the {@link | ||||||
|  * net.sf.acegisecurity.util.FilterToBeanProxy}. |  * net.sf.acegisecurity.util.FilterToBeanProxy}. | ||||||
|  * </p> |  * </p> | ||||||
| @ -93,14 +93,14 @@ public class AnonymousProcessingFilter implements Filter, InitializingBean { | |||||||
| 
 | 
 | ||||||
|                 if (logger.isDebugEnabled()) { |                 if (logger.isDebugEnabled()) { | ||||||
|                     logger.debug( |                     logger.debug( | ||||||
|                         "Replaced SecurityContextHolder with anonymous token: '" + |                         "Populated SecurityContextHolder with anonymous token: '" + | ||||||
|                         SecurityContextHolder.getContext().getAuthentication() + |                         SecurityContextHolder.getContext().getAuthentication() + | ||||||
|                         "'"); |                         "'"); | ||||||
|                 } |                 } | ||||||
|             } else { |             } else { | ||||||
|                 if (logger.isDebugEnabled()) { |                 if (logger.isDebugEnabled()) { | ||||||
|                     logger.debug( |                     logger.debug( | ||||||
|                         "SecurityContextHolder not replaced with anonymous token, as ContextHolder already contained: '" + |                         "SecurityContextHolder not populated with anonymous token, as it already contained: '" + | ||||||
|                         SecurityContextHolder.getContext().getAuthentication() + |                         SecurityContextHolder.getContext().getAuthentication() + | ||||||
|                         "'"); |                         "'"); | ||||||
|                 } |                 } | ||||||
| @ -119,11 +119,10 @@ public class AnonymousProcessingFilter implements Filter, InitializingBean { | |||||||
|     /** |     /** | ||||||
|      * Does nothing - we reply on IoC lifecycle services instead. |      * Does nothing - we reply on IoC lifecycle services instead. | ||||||
|      * |      * | ||||||
|      * @param arg0 DOCUMENT ME! |      * @param ignored not used | ||||||
|      * |      * | ||||||
|      * @throws ServletException DOCUMENT ME! |  | ||||||
|      */ |      */ | ||||||
|     public void init(FilterConfig arg0) throws ServletException { |     public void init(FilterConfig ignored) throws ServletException { | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
| @ -157,8 +156,8 @@ public class AnonymousProcessingFilter implements Filter, InitializingBean { | |||||||
|      * Controls whether the filter will remove the Anonymous token |      * Controls whether the filter will remove the Anonymous token | ||||||
|      * after the request is complete. Generally this is desired to |      * after the request is complete. Generally this is desired to | ||||||
|      * avoid the expense of a session being created by |      * avoid the expense of a session being created by | ||||||
|      * {@link net.sf.acegisecurity.context.HttpSessionContextIntegrationFilter} simply |      * {@link net.sf.acegisecurity.context.HttpSessionContextIntegrationFilter HttpSessionContextIntegrationFilter} | ||||||
|      * to store the Anonymous authentication token. |      * simply to store the Anonymous authentication token. | ||||||
|      * |      * | ||||||
|      * <p>Defaults to <code>true</code>, |      * <p>Defaults to <code>true</code>, | ||||||
|      * being the most optimal and appropriate option (ie <code>AnonymousProcessingFilter</code> |      * being the most optimal and appropriate option (ie <code>AnonymousProcessingFilter</code> | ||||||
|  | |||||||
| @ -30,13 +30,14 @@ import javax.security.auth.spi.LoginModule; | |||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * An implementation of {@link LoginModule} that uses an Acegi Security {@link |  * An implementation of {@link LoginModule} that uses an Acegi Security | ||||||
|  * SecureContext} to provide authentication. <br> |  * {@link net.sf.acegisecurity.context.SecurityContext SecurityContext} | ||||||
|  |  * to provide authentication. <br /> | ||||||
|  * This LoginModule provides opposite functionality to the {@link |  * This LoginModule provides opposite functionality to the {@link | ||||||
|  * JaasAuthenticationProvider} API, and should not really be used in |  * JaasAuthenticationProvider} API, and should not really be used in | ||||||
|  * conjunction. <br> |  * conjunction with it. <br /> | ||||||
|  * The {@link JaasAuthenticationProvider} allows Acegi to authenticate against |  * The {@link JaasAuthenticationProvider} allows Acegi to authenticate against | ||||||
|  * Jaas. <br> |  * Jaas. <br /> | ||||||
|  * The SecureContextLoginModule allows a Jaas based application to |  * The SecureContextLoginModule allows a Jaas based application to | ||||||
|  * authenticate against Acegi. If there is no Authentication in the {@link |  * authenticate against Acegi. If there is no Authentication in the {@link | ||||||
|  * SecurityContextHolder} the login() method will throw a LoginException by |  * SecurityContextHolder} the login() method will throw a LoginException by | ||||||
| @ -126,7 +127,7 @@ public class SecureContextLoginModule implements LoginModule { | |||||||
|     /** |     /** | ||||||
|      * Authenticate the <code>Subject</code> (phase one) by extracting the |      * Authenticate the <code>Subject</code> (phase one) by extracting the | ||||||
|      * Acegi Security <code>Authentication</code> from the current |      * Acegi Security <code>Authentication</code> from the current | ||||||
|      * <code>SecureContext</code>. |      * <code>SecurityContext</code>. | ||||||
|      * |      * | ||||||
|      * @return true if the authentication succeeded, or false if this |      * @return true if the authentication succeeded, or false if this | ||||||
|      *         <code>LoginModule</code> should be ignored. |      *         <code>LoginModule</code> should be ignored. | ||||||
|  | |||||||
| @ -54,7 +54,7 @@ import javax.servlet.jsp.tagext.TagSupport; | |||||||
|  * One or more comma separate integer permissions are specified via the |  * One or more comma separate integer permissions are specified via the | ||||||
|  * <code>hasPermission</code> attribute. The tag will include its body if |  * <code>hasPermission</code> attribute. The tag will include its body if | ||||||
|  * <b>any</b> of the integer permissions have been granted to the current |  * <b>any</b> of the integer permissions have been granted to the current | ||||||
|  * <code>Authentication</code> (obtained from the <code>ContextHolder</code>). |  * <code>Authentication</code> (obtained from the <code>SecurityContextHolder</code>). | ||||||
|  * </p> |  * </p> | ||||||
|  *  |  *  | ||||||
|  * <p> |  * <p> | ||||||
|  | |||||||
| @ -172,7 +172,7 @@ public class BasicProcessingFilter implements Filter, InitializingBean { | |||||||
|                 password = token.substring(delim + 1); |                 password = token.substring(delim + 1); | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             // Only reauthenticate if username doesn't match ContextHolder and user isn't authenticated (see SEC-53) |             // Only reauthenticate if username doesn't match SecurityContextHolder and user isn't authenticated (see SEC-53) | ||||||
|             Authentication existingAuth = SecurityContextHolder.getContext() |             Authentication existingAuth = SecurityContextHolder.getContext() | ||||||
|                                                                .getAuthentication(); |                                                                .getAuthentication(); | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -54,11 +54,11 @@ import javax.servlet.http.HttpServletResponse; | |||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Processes a HTTP request's Digest authorization headers, putting the result |  * Processes a HTTP request's Digest authorization headers, putting the result | ||||||
|  * into the <code>ContextHolder</code>. |  * into the <code>SecurityContextHolder</code>. | ||||||
|  *  |  *  | ||||||
|  * <P> |  * <p> | ||||||
|  * For a detailed background on what this filter is designed to process, refer |  * For a detailed background on what this filter is designed to process, refer | ||||||
|  * to <A HREF="http://www.ietf.org/rfc/rfc2617.txt">RFC 2617</A> (which |  * to <a href="http://www.ietf.org/rfc/rfc2617.txt">RFC 2617</a> (which | ||||||
|  * superseded RFC 2069, although this filter support clients that implement |  * superseded RFC 2069, although this filter support clients that implement | ||||||
|  * either RFC 2617 or RFC 2069). |  * either RFC 2617 or RFC 2069). | ||||||
|  * </p> |  * </p> | ||||||
| @ -72,18 +72,18 @@ import javax.servlet.http.HttpServletResponse; | |||||||
|  * <p> |  * <p> | ||||||
|  * This Digest implementation has been designed to avoid needing to store |  * This Digest implementation has been designed to avoid needing to store | ||||||
|  * session state between invocations. All session management information is |  * session state between invocations. All session management information is | ||||||
|  * stored in the "nonce" that is sent to the client by the {@link |  * stored in the "nonce" that is sent to the client by the {@link DigestProcessingFilterEntryPoint}. | ||||||
|  * net.sf.acegisecurity.ui.digestauth.DigestProcessingFilterEntryPoint}. |  | ||||||
|  * </p> |  * </p> | ||||||
|  *  |  *  | ||||||
|  * <P> |  * <P> | ||||||
|  * If authentication is successful, the resulting {@link Authentication} object |  * If authentication is successful, the resulting {@link net.sf.acegisecurity.Authentication Authentication} | ||||||
|  * will be placed into the <code>ContextHolder</code>. |  * object will be placed into the <code>SecurityContextHolder</code>. | ||||||
|  * </p> |  * </p> | ||||||
|  *  |  *  | ||||||
|  * <p> |  * <p> | ||||||
|  * If authentication fails, an {@link AuthenticationEntryPoint} implementation |  * If authentication fails, an | ||||||
|  * is called. This must always be {@link DigestProcessingFilterEntryPoint}, |  * {@link net.sf.acegisecurity.intercept.web.AuthenticationEntryPoint AuthenticationEntryPoint} | ||||||
|  |  * implementation is called. This must always be {@link DigestProcessingFilterEntryPoint}, | ||||||
|  * which will prompt the user to authenticate again via Digest authentication. |  * which will prompt the user to authenticate again via Digest authentication. | ||||||
|  * </p> |  * </p> | ||||||
|  *  |  *  | ||||||
| @ -432,7 +432,7 @@ public class DigestProcessingFilter implements Filter, InitializingBean { | |||||||
|         return userCache; |         return userCache; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     public void init(FilterConfig arg0) throws ServletException {} |     public void init(FilterConfig ignored) throws ServletException {} | ||||||
| 
 | 
 | ||||||
|     private void fail(ServletRequest request, ServletResponse response, |     private void fail(ServletRequest request, ServletResponse response, | ||||||
|         AuthenticationException failed) throws IOException, ServletException { |         AuthenticationException failed) throws IOException, ServletException { | ||||||
|  | |||||||
| @ -65,8 +65,8 @@ import javax.servlet.http.HttpServletResponse; | |||||||
|  * via an <code>AuthenticationManager</code>-specific application event. |  * via an <code>AuthenticationManager</code>-specific application event. | ||||||
|  * </p> |  * </p> | ||||||
|  *  |  *  | ||||||
|  * <P> |  * <p> | ||||||
|  * <B>Do not use this class directly.</B> Instead configure |  * <b>Do not use this class directly.</b> Instead configure | ||||||
|  * <code>web.xml</code> to use the {@link |  * <code>web.xml</code> to use the {@link | ||||||
|  * net.sf.acegisecurity.util.FilterToBeanProxy}. |  * net.sf.acegisecurity.util.FilterToBeanProxy}. | ||||||
|  * </p> |  * </p> | ||||||
| @ -130,7 +130,7 @@ public class RememberMeProcessingFilter implements Filter, InitializingBean, | |||||||
| 
 | 
 | ||||||
|                 if (logger.isDebugEnabled()) { |                 if (logger.isDebugEnabled()) { | ||||||
|                     logger.debug( |                     logger.debug( | ||||||
|                         "Replaced SecurityContextHolder with remember-me token: '" |                         "SecurityContextHolder populated with remember-me token: '" | ||||||
|                         + SecurityContextHolder.getContext().getAuthentication() |                         + SecurityContextHolder.getContext().getAuthentication() | ||||||
|                         + "'"); |                         + "'"); | ||||||
|                 } |                 } | ||||||
| @ -145,7 +145,7 @@ public class RememberMeProcessingFilter implements Filter, InitializingBean, | |||||||
|         } else { |         } else { | ||||||
|             if (logger.isDebugEnabled()) { |             if (logger.isDebugEnabled()) { | ||||||
|                 logger.debug( |                 logger.debug( | ||||||
|                     "SecurityContextHolder not replaced with remember-me token, as SecurityContextHolder already contained: '" |                     "SecurityContextHolder not populated with remember-me token, as it already contained: '" | ||||||
|                     + SecurityContextHolder.getContext().getAuthentication() |                     + SecurityContextHolder.getContext().getAuthentication() | ||||||
|                     + "'"); |                     + "'"); | ||||||
|             } |             } | ||||||
| @ -157,9 +157,8 @@ public class RememberMeProcessingFilter implements Filter, InitializingBean, | |||||||
|     /** |     /** | ||||||
|      * Does nothing - we rely on IoC lifecycle services instead. |      * Does nothing - we rely on IoC lifecycle services instead. | ||||||
|      * |      * | ||||||
|      * @param arg0 not used |      * @param ignored not used | ||||||
|      * |      * | ||||||
|      * @throws ServletException not thrown |  | ||||||
|      */ |      */ | ||||||
|     public void init(FilterConfig arg0) throws ServletException {} |     public void init(FilterConfig ignored) throws ServletException {} | ||||||
| } | } | ||||||
|  | |||||||
| @ -54,7 +54,7 @@ public interface RememberMeServices { | |||||||
|     //~ Methods ================================================================ |     //~ Methods ================================================================ | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|      * This method will be called whenever the <code>ContextHolder</code> does |      * This method will be called whenever the <code>SecurityContextHolder</code> does | ||||||
|      * not contain an <code>Authentication</code> and the Acegi Security |      * not contain an <code>Authentication</code> and the Acegi Security | ||||||
|      * system wishes to provide an implementation with an opportunity to |      * system wishes to provide an implementation with an opportunity to | ||||||
|      * authenticate the request using remember-me capabilities. Acegi Security |      * authenticate the request using remember-me capabilities. Acegi Security | ||||||
|  | |||||||
| @ -238,7 +238,7 @@ public class TokenBasedRememberMeServices implements RememberMeServices, | |||||||
|                         // Must do this after user lookup, as we need the DAO-derived password |                         // Must do this after user lookup, as we need the DAO-derived password | ||||||
|                         // If efficiency was a major issue, just add in a UserCache implementation, |                         // If efficiency was a major issue, just add in a UserCache implementation, | ||||||
|                         // but recall this method is usually only called one per HttpSession |                         // but recall this method is usually only called one per HttpSession | ||||||
|                         // (as if the token is valid, it will cause ContextHolder population, whilst |                         // (as if the token is valid, it will cause SecurityContextHolder population, whilst | ||||||
|                         // if invalid, will cause the cookie to be cancelled) |                         // if invalid, will cause the cookie to be cancelled) | ||||||
|                         String expectedTokenSignature = DigestUtils.md5Hex(userDetails |                         String expectedTokenSignature = DigestUtils.md5Hex(userDetails | ||||||
|                                 .getUsername() + ":" + tokenExpiryTime + ":" |                                 .getUsername() + ":" + tokenExpiryTime + ":" | ||||||
|  | |||||||
| @ -78,7 +78,7 @@ import javax.servlet.http.HttpServletResponse; | |||||||
|  * </p> |  * </p> | ||||||
|  *  |  *  | ||||||
|  * <p> |  * <p> | ||||||
|  * On successful switch, the user's  <code>SecureContextHolder</code> will be |  * On successful switch, the user's  <code>SecurityContextHolder</code> will be | ||||||
|  * updated to reflect the specified user and will also contain an additinal |  * updated to reflect the specified user and will also contain an additinal | ||||||
|  * {@link net.sf.acegisecurity.ui.switchuser.SwitchUserGrantedAuthority } |  * {@link net.sf.acegisecurity.ui.switchuser.SwitchUserGrantedAuthority } | ||||||
|  * which contains the original user. |  * which contains the original user. | ||||||
| @ -224,7 +224,7 @@ public class SwitchUserProcessingFilter implements Filter, InitializingBean, | |||||||
|         chain.doFilter(request, response); |         chain.doFilter(request, response); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     public void init(FilterConfig filterConfig) throws ServletException {} |     public void init(FilterConfig ignored) throws ServletException {} | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|      * Attempt to exit from an already switched user. |      * Attempt to exit from an already switched user. | ||||||
|  | |||||||
| @ -165,7 +165,7 @@ public class X509ProcessingFilter implements Filter, InitializingBean, | |||||||
|         filterChain.doFilter(request, response); |         filterChain.doFilter(request, response); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     public void init(FilterConfig filterConfig) throws ServletException {} |     public void init(FilterConfig ignored) throws ServletException {} | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|      * Puts the <code>Authentication</code> instance returned by the |      * Puts the <code>Authentication</code> instance returned by the | ||||||
| @ -206,7 +206,7 @@ public class X509ProcessingFilter implements Filter, InitializingBean, | |||||||
|         SecurityContextHolder.getContext().setAuthentication(null); |         SecurityContextHolder.getContext().setAuthentication(null); | ||||||
| 
 | 
 | ||||||
|         if (logger.isDebugEnabled()) { |         if (logger.isDebugEnabled()) { | ||||||
|             logger.debug("Updated ContextHolder to contain null Authentication"); |             logger.debug("Updated SecurityContextHolder to contain null Authentication"); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         request.getSession().setAttribute(AbstractProcessingFilter.ACEGI_SECURITY_LAST_EXCEPTION_KEY, |         request.getSession().setAttribute(AbstractProcessingFilter.ACEGI_SECURITY_LAST_EXCEPTION_KEY, | ||||||
|  | |||||||
| @ -53,7 +53,7 @@ public class ContextHolderAwareRequestWrapper extends HttpServletRequestWrapper | |||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|      * Returns the principal's name, as obtained from the |      * Returns the principal's name, as obtained from the | ||||||
|      * <code>ContextHolder</code>. Properly handles both |      * <code>SecurityContextHolder</code>. Properly handles both | ||||||
|      * <code>String</code>-based and <code>UserDetails</code>-based |      * <code>String</code>-based and <code>UserDetails</code>-based | ||||||
|      * principals. |      * principals. | ||||||
|      * |      * | ||||||
| @ -78,7 +78,7 @@ public class ContextHolderAwareRequestWrapper extends HttpServletRequestWrapper | |||||||
|      * GrantedAuthority#getAuthority()}. |      * GrantedAuthority#getAuthority()}. | ||||||
|      *  |      *  | ||||||
|      * <p> |      * <p> | ||||||
|      * Will always return <code>false</code> if the <code>ContextHolder</code> |      * Will always return <code>false</code> if the <code>SecurityContextHolder</code> | ||||||
|      * contains an <code>Authentication</code> with |      * contains an <code>Authentication</code> with | ||||||
|      * <code>null</code><code>principal</code> and/or |      * <code>null</code><code>principal</code> and/or | ||||||
|      * <code>GrantedAuthority[]</code> objects. |      * <code>GrantedAuthority[]</code> objects. | ||||||
|  | |||||||
| @ -69,7 +69,7 @@ public class ContextPropagatingRemoteInvocationTests extends TestCase { | |||||||
|         SecurityContextHolder.setContext(new SecurityContextImpl()); |         SecurityContextHolder.setContext(new SecurityContextImpl()); | ||||||
| 
 | 
 | ||||||
|         // The result from invoking the TargetObject should contain the |         // The result from invoking the TargetObject should contain the | ||||||
|         // Authentication class delivered via the ContextHolder |         // Authentication class delivered via the SecurityContextHolder | ||||||
|         assertEquals("some_string net.sf.acegisecurity.providers.UsernamePasswordAuthenticationToken false", |         assertEquals("some_string net.sf.acegisecurity.providers.UsernamePasswordAuthenticationToken false", | ||||||
|             remoteInvocation.invoke(new TargetObject())); |             remoteInvocation.invoke(new TargetObject())); | ||||||
|     } |     } | ||||||
|  | |||||||
| @ -83,7 +83,7 @@ public class SecurityEnforcementFilterTests extends TestCase { | |||||||
|         MockFilterSecurityInterceptor interceptor = new MockFilterSecurityInterceptor(true, |         MockFilterSecurityInterceptor interceptor = new MockFilterSecurityInterceptor(true, | ||||||
|                 false, false, false); |                 false, false, false); | ||||||
| 
 | 
 | ||||||
|         // Setup ContextHolder, as filter needs to check if user is anonymous |         // Setup SecurityContextHolder, as filter needs to check if user is anonymous | ||||||
|         SecurityContextHolder.getContext().setAuthentication(new AnonymousAuthenticationToken( |         SecurityContextHolder.getContext().setAuthentication(new AnonymousAuthenticationToken( | ||||||
|                 "ignored", "ignored", |                 "ignored", "ignored", | ||||||
|                 new GrantedAuthority[] {new GrantedAuthorityImpl("IGNORED")})); |                 new GrantedAuthority[] {new GrantedAuthorityImpl("IGNORED")})); | ||||||
| @ -113,7 +113,7 @@ public class SecurityEnforcementFilterTests extends TestCase { | |||||||
|         MockFilterSecurityInterceptor interceptor = new MockFilterSecurityInterceptor(true, |         MockFilterSecurityInterceptor interceptor = new MockFilterSecurityInterceptor(true, | ||||||
|                 false, false, false); |                 false, false, false); | ||||||
| 
 | 
 | ||||||
|         // Setup ContextHolder, as filter needs to check if user is anonymous |         // Setup SecurityContextHolder, as filter needs to check if user is anonymous | ||||||
|         SecurityContextHolder.getContext().setAuthentication(null); |         SecurityContextHolder.getContext().setAuthentication(null); | ||||||
| 
 | 
 | ||||||
|         // Test |         // Test | ||||||
|  | |||||||
| @ -104,7 +104,7 @@ public class AnonymousProcessingFilterTests extends TestCase { | |||||||
| 
 | 
 | ||||||
|     public void testOperationWhenAuthenticationExistsInContextHolder() |     public void testOperationWhenAuthenticationExistsInContextHolder() | ||||||
|         throws Exception { |         throws Exception { | ||||||
|         // Put an Authentication object into the ContextHolder |         // Put an Authentication object into the SecurityContextHolder | ||||||
|         Authentication originalAuth = new TestingAuthenticationToken("user", |         Authentication originalAuth = new TestingAuthenticationToken("user", | ||||||
|                 "password", |                 "password", | ||||||
|                 new GrantedAuthority[] { new GrantedAuthorityImpl("ROLE_A") }); |                 new GrantedAuthority[] { new GrantedAuthorityImpl("ROLE_A") }); | ||||||
|  | |||||||
| @ -30,7 +30,7 @@ import javax.security.auth.login.LoginException; | |||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * DOCUMENT ME! |  * Testst SecureContextLoginModule | ||||||
|  * |  * | ||||||
|  * @author Ray Krueger |  * @author Ray Krueger | ||||||
|  */ |  */ | ||||||
| @ -57,7 +57,7 @@ public class SecureContextLoginModuleTests extends TestCase { | |||||||
|         try { |         try { | ||||||
|             module.login(); |             module.login(); | ||||||
|             fail( |             fail( | ||||||
|                 "LoginException expected, there is no Authentication in the SecureContext"); |                 "LoginException expected, there is no Authentication in the SecurityContext"); | ||||||
|         } catch (LoginException e) {} |         } catch (LoginException e) {} | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| @ -87,7 +87,7 @@ public class SecureContextLoginModuleTests extends TestCase { | |||||||
|         try { |         try { | ||||||
|             SecurityContextHolder.getContext().setAuthentication(null); |             SecurityContextHolder.getContext().setAuthentication(null); | ||||||
|             module.login(); |             module.login(); | ||||||
|             fail("LoginException expected, the authentication is null in the SecureContext"); |             fail("LoginException expected, the authentication is null in the SecurityContext"); | ||||||
|         } catch (Exception e) { |         } catch (Exception e) { | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  | |||||||
| @ -118,7 +118,7 @@ public class RememberMeProcessingFilterTests extends TestCase { | |||||||
| 
 | 
 | ||||||
|     public void testOperationWhenAuthenticationExistsInContextHolder() |     public void testOperationWhenAuthenticationExistsInContextHolder() | ||||||
|         throws Exception { |         throws Exception { | ||||||
|         // Put an Authentication object into the ContextHolder |         // Put an Authentication object into the SecurityContextHolder | ||||||
|         Authentication originalAuth = new TestingAuthenticationToken("user", |         Authentication originalAuth = new TestingAuthenticationToken("user", | ||||||
|                 "password", |                 "password", | ||||||
|                 new GrantedAuthority[] {new GrantedAuthorityImpl("ROLE_A")}); |                 new GrantedAuthority[] {new GrantedAuthorityImpl("ROLE_A")}); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user