View Javadoc

1   /* Copyright 2004 Acegi Technology Pty Limited
2    *
3    * Licensed under the Apache License, Version 2.0 (the "License");
4    * you may not use this file except in compliance with the License.
5    * You may obtain a copy of the License at
6    *
7    *     http://www.apache.org/licenses/LICENSE-2.0
8    *
9    * Unless required by applicable law or agreed to in writing, software
10   * distributed under the License is distributed on an "AS IS" BASIS,
11   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12   * See the License for the specific language governing permissions and
13   * limitations under the License.
14   */
15  
16  package org.acegisecurity.intercept.web;
17  
18  import org.acegisecurity.AuthenticationException;
19  
20  import java.io.IOException;
21  
22  import javax.servlet.ServletException;
23  import javax.servlet.ServletRequest;
24  import javax.servlet.ServletResponse;
25  
26  
27  /***
28   * Used by {@link SecurityEnforcementFilter} to commence an authentication
29   * scheme.
30   *
31   * @author Ben Alex
32   * @version $Id: AuthenticationEntryPoint.java,v 1.4 2005/11/17 00:55:50 benalex Exp $
33   */
34  public interface AuthenticationEntryPoint {
35      //~ Methods ================================================================
36  
37      /***
38       * Commences an authentication scheme.
39       * 
40       * <P>
41       * <code>SecurityEnforcementFilter</code> will populate the
42       * <code>HttpSession</code> attribute named
43       * <code>AuthenticationProcessingFilter.ACEGI_SECURITY_TARGET_URL_KEY</code>
44       * with the requested target URL before calling this method.
45       * </p>
46       * 
47       * <P>
48       * Implementations should modify the headers on the
49       * <code>ServletResponse</code> as necessary to commence the
50       * authentication process.
51       * </p>
52       *
53       * @param request that resulted in an <code>AuthenticationException</code>
54       * @param response so that the user agent can begin authentication
55       * @param authException that caused the invocation
56       */
57      public void commence(ServletRequest request, ServletResponse response,
58          AuthenticationException authException)
59          throws IOException, ServletException;
60  }