KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > catalina > authenticator > NonLoginAuthenticator


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * 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
19 package org.apache.catalina.authenticator;
20
21
22 import java.io.IOException JavaDoc;
23
24 import org.apache.catalina.connector.Request;
25 import org.apache.catalina.connector.Response;
26 import org.apache.catalina.deploy.LoginConfig;
27
28
29
30 /**
31  * An <b>Authenticator</b> and <b>Valve</b> implementation that checks
32  * only security constraints not involving user authentication.
33  *
34  * @author Craig R. McClanahan
35  * @version $Revision: 467222 $ $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. 2006) $
36  */

37
38 public final class NonLoginAuthenticator
39     extends AuthenticatorBase {
40
41
42     // ----------------------------------------------------- Instance Variables
43

44
45     /**
46      * Descriptive information about this implementation.
47      */

48     private static final String JavaDoc info =
49         "org.apache.catalina.authenticator.NonLoginAuthenticator/1.0";
50
51
52     // ------------------------------------------------------------- Properties
53

54
55     /**
56      * Return descriptive information about this Valve implementation.
57      */

58     public String JavaDoc getInfo() {
59
60         return (info);
61
62     }
63
64
65     // --------------------------------------------------------- Public Methods
66

67
68     /**
69      * Authenticate the user making this request, based on the specified
70      * login configuration. Return <code>true</code> if any specified
71      * constraint has been satisfied, or <code>false</code> if we have
72      * created a response challenge already.
73      *
74      * @param request Request we are processing
75      * @param response Response we are creating
76      * @param config Login configuration describing how authentication
77      * should be performed
78      *
79      * @exception IOException if an input/output error occurs
80      */

81     public boolean authenticate(Request request,
82                                 Response response,
83                                 LoginConfig config)
84         throws IOException JavaDoc {
85
86         /* Associating this request's session with an SSO would allow
87             coordinated session invalidation, but should the session for
88             a webapp that the user didn't log into be invalidated when
89             another session is logged out?
90         String ssoId = (String) request.getNote(Constants.REQ_SSOID_NOTE);
91         if (ssoId != null)
92             associate(ssoId, getSession(request, true));
93         */

94         
95         if (containerLog.isDebugEnabled())
96             containerLog.debug("User authentication is not required");
97         return (true);
98
99
100     }
101
102
103 }
104
Popular Tags