01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: package org.apache.catalina.authenticator;
19:
20: import java.io.IOException;
21:
22: import org.apache.catalina.connector.Request;
23: import org.apache.catalina.connector.Response;
24: import org.apache.catalina.deploy.LoginConfig;
25:
26: /**
27: * An <b>Authenticator</b> and <b>Valve</b> implementation that checks
28: * only security constraints not involving user authentication.
29: *
30: * @author Craig R. McClanahan
31: * @version $Revision: 467222 $ $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. 2006) $
32: */
33:
34: public final class NonLoginAuthenticator extends AuthenticatorBase {
35:
36: // ----------------------------------------------------- Instance Variables
37:
38: /**
39: * Descriptive information about this implementation.
40: */
41: private static final String info = "org.apache.catalina.authenticator.NonLoginAuthenticator/1.0";
42:
43: // ------------------------------------------------------------- Properties
44:
45: /**
46: * Return descriptive information about this Valve implementation.
47: */
48: public String getInfo() {
49:
50: return (info);
51:
52: }
53:
54: // --------------------------------------------------------- Public Methods
55:
56: /**
57: * Authenticate the user making this request, based on the specified
58: * login configuration. Return <code>true</code> if any specified
59: * constraint has been satisfied, or <code>false</code> if we have
60: * created a response challenge already.
61: *
62: * @param request Request we are processing
63: * @param response Response we are creating
64: * @param config Login configuration describing how authentication
65: * should be performed
66: *
67: * @exception IOException if an input/output error occurs
68: */
69: public boolean authenticate(Request request, Response response,
70: LoginConfig config) throws IOException {
71:
72: /* Associating this request's session with an SSO would allow
73: coordinated session invalidation, but should the session for
74: a webapp that the user didn't log into be invalidated when
75: another session is logged out?
76: String ssoId = (String) request.getNote(Constants.REQ_SSOID_NOTE);
77: if (ssoId != null)
78: associate(ssoId, getSession(request, true));
79: */
80:
81: if (containerLog.isDebugEnabled())
82: containerLog.debug("User authentication is not required");
83: return (true);
84:
85: }
86:
87: }
|