View Javadoc

1   // ========================================================================
2   // Copyright (c) 2008-2009 Mort Bay Consulting Pty. Ltd.
3   // ------------------------------------------------------------------------
4   // All rights reserved. This program and the accompanying materials
5   // are made available under the terms of the Eclipse Public License v1.0
6   // and Apache License v2.0 which accompanies this distribution.
7   // The Eclipse Public License is available at 
8   // http://www.eclipse.org/legal/epl-v10.html
9   // The Apache License v2.0 is available at
10  // http://www.opensource.org/licenses/apache2.0.php
11  // You may elect to redistribute this code under either of these licenses. 
12  // ========================================================================
13  
14  package org.eclipse.jetty.security.authentication;
15  
16  import javax.servlet.ServletRequest;
17  import javax.servlet.ServletResponse;
18  
19  import org.eclipse.jetty.security.Authenticator;
20  import org.eclipse.jetty.security.ServerAuthException;
21  import org.eclipse.jetty.server.Authentication;
22  import org.eclipse.jetty.server.Authentication.User;
23  
24  public class DelegateAuthenticator implements Authenticator
25  {
26      protected final Authenticator _delegate;
27  
28      public void setConfiguration(Configuration configuration)
29      {
30          _delegate.setConfiguration(configuration);
31      }
32  
33      public String getAuthMethod()
34      {
35          return _delegate.getAuthMethod();
36      }
37      
38      public DelegateAuthenticator(Authenticator delegate)
39      {
40          _delegate=delegate;
41      }
42  
43      public Authenticator getDelegate()
44      {
45          return _delegate;
46      }
47  
48      public Authentication validateRequest(ServletRequest request, ServletResponse response, boolean manditory) throws ServerAuthException
49      {
50          return _delegate.validateRequest(request, response, manditory);
51      }
52  
53      public boolean secureResponse(ServletRequest req, ServletResponse res, boolean mandatory, User validatedUser) throws ServerAuthException
54      {
55          return _delegate.secureResponse(req,res, mandatory, validatedUser);
56      }
57      
58  }