001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017:
018: package org.apache.catalina.authenticator;
019:
020: public class Constants {
021:
022: public static final String Package = "org.apache.catalina.authenticator";
023:
024: // Authentication methods for login configuration
025: public static final String BASIC_METHOD = "BASIC";
026: public static final String CERT_METHOD = "CLIENT_CERT";
027: public static final String DIGEST_METHOD = "DIGEST";
028: public static final String FORM_METHOD = "FORM";
029:
030: // User data constraints for transport guarantee
031: public static final String NONE_TRANSPORT = "NONE";
032: public static final String INTEGRAL_TRANSPORT = "INTEGRAL";
033: public static final String CONFIDENTIAL_TRANSPORT = "CONFIDENTIAL";
034:
035: // Form based authentication constants
036: public static final String FORM_ACTION = "/j_security_check";
037: public static final String FORM_PASSWORD = "j_password";
038: public static final String FORM_USERNAME = "j_username";
039:
040: // Cookie name for single sign on support
041: public static final String SINGLE_SIGN_ON_COOKIE = "JSESSIONIDSSO";
042:
043: // --------------------------------------------------------- Request Notes
044:
045: /**
046: * <p>If a user has been authenticated by the web layer, by means of a
047: * login method other than CLIENT_CERT, the username and password
048: * used to authenticate the user will be attached to the request as
049: * Notes for use by other server components. A server component can
050: * also call several existing methods on Request to determine whether
051: * or not any user has been authenticated:</p>
052: * <ul>
053: * <li><strong>request.getAuthType()</strong>
054: * will return BASIC, CLIENT_CERT, DIGEST, FORM, or <code>null</code>
055: * if there is no authenticated user.</li>
056: * <li><strong>request.getUserPrincipal()</strong>
057: * will return the authenticated <code>Principal</code> returned by the
058: * <code>Realm</code> that authenticated this user.</li>
059: * </ul>
060: * <p>If CLIENT_CERT authentication was performed, the certificate chain
061: * will be available as a request attribute, as defined in the
062: * servlet specification.</p>
063: */
064:
065: /**
066: * The notes key for the password used to authenticate this user.
067: */
068: public static final String REQ_PASSWORD_NOTE = "org.apache.catalina.request.PASSWORD";
069:
070: /**
071: * The notes key for the username used to authenticate this user.
072: */
073: public static final String REQ_USERNAME_NOTE = "org.apache.catalina.request.USERNAME";
074:
075: /**
076: * The notes key to track the single-sign-on identity with which this
077: * request is associated.
078: */
079: public static final String REQ_SSOID_NOTE = "org.apache.catalina.request.SSOID";
080:
081: // ---------------------------------------------------------- Session Notes
082:
083: /**
084: * If the <code>cache</code> property of our authenticator is set, and
085: * the current request is part of a session, authentication information
086: * will be cached to avoid the need for repeated calls to
087: * <code>Realm.authenticate()</code>, under the following keys:
088: */
089:
090: /**
091: * The notes key for the password used to authenticate this user.
092: */
093: public static final String SESS_PASSWORD_NOTE = "org.apache.catalina.session.PASSWORD";
094:
095: /**
096: * The notes key for the username used to authenticate this user.
097: */
098: public static final String SESS_USERNAME_NOTE = "org.apache.catalina.session.USERNAME";
099:
100: /**
101: * The following note keys are used during form login processing to
102: * cache required information prior to the completion of authentication.
103: */
104:
105: /**
106: * The previously authenticated principal (if caching is disabled).
107: */
108: public static final String FORM_PRINCIPAL_NOTE = "org.apache.catalina.authenticator.PRINCIPAL";
109:
110: /**
111: * The original request information, to which the user will be
112: * redirected if authentication succeeds.
113: */
114: public static final String FORM_REQUEST_NOTE = "org.apache.catalina.authenticator.REQUEST";
115:
116: }
|