42a452a9f1193f232b34e7c22706b8fe44207d3dPhill Cunnington/*
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Copyright (c) 2005 Sun Microsystems Inc. All Rights Reserved
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * The contents of this file are subject to the terms
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * of the Common Development and Distribution License
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * (the License). You may not use this file except in
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * compliance with the License.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * You can obtain a copy of the License at
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * https://opensso.dev.java.net/public/CDDLv1.0.html or
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * opensso/legal/CDDLv1.0.txt
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * See the License for the specific language governing
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * permission and limitations under the License.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * When distributing Covered Code, include this CDDL
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Header Notice in each file and include the License file
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * at opensso/legal/CDDLv1.0.txt.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * If applicable, add the following below the CDDL Header,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * with the fields enclosed by brackets [] replaced by
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * your own identifying information:
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * "Portions Copyrighted [year] [name of copyright owner]"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * $Id: AuthContextLocal.java,v 1.12 2009/05/21 21:57:34 qcheng Exp $
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
42a452a9f1193f232b34e7c22706b8fe44207d3dPhill Cunnington * Portions Copyright 2013-2015 ForgeRock AS.
91cb2bef1c88e70b5d433c2a34bca110a35786ceMark Craig */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterpackage com.sun.identity.authentication.server;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport com.iplanet.sso.SSOToken;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport com.sun.identity.authentication.AuthContext;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport com.sun.identity.authentication.service.AMLoginContext;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport com.sun.identity.authentication.service.LoginState;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport com.sun.identity.authentication.service.LoginStatus;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport com.sun.identity.authentication.spi.AuthLoginException;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport com.sun.identity.authentication.spi.PagePropertiesCallback;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport com.sun.identity.authentication.util.ISAuthConstants;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport com.sun.identity.policy.PolicyException;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport com.sun.identity.policy.util.PolicyDecisionUtils;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport com.sun.identity.shared.encode.URLEncDec;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport com.sun.identity.shared.debug.Debug;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport com.sun.identity.shared.locale.Locale;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport java.security.Principal;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport java.util.ArrayList;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport java.util.Collections;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport java.util.HashMap;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport java.util.List;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport java.util.Map;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport java.util.ResourceBundle;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport java.util.Set;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport javax.security.auth.Subject;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport javax.security.auth.callback.Callback;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport javax.servlet.http.HttpSession;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster/**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * The <code>AuthContextLocal</code> provides the implementation for
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * authenticating users.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * <p>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * A typical caller instantiates this class and starts the login process.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * The caller then obtains an array of <code>Callback</code> objects,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * which contains the information required by the authentication plug-in
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * module. The caller requests information from the user. On receiving
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * the information from the user, the caller submits the same to this class.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * If more information is required, the above process continues until all
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * the information required by the plug-ins/authentication modules, has
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * been supplied. The caller then checks if the user has successfully
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * been authenticated. If successfully authenticated, the caller can
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * then get the <code>Subject</code> and <code>SSOToken</code> for the user;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * if not successfully authenticated, the caller obtains the AuthLoginException.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * <p>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * The implementation supports authenticating users either locally
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * i.e., in process with all authentication modules configured or remotely
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * to an authentication service/framework. (See documentation to configure
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * in either of the modes).
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * <p>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * The <code>getRequirements()</code> and <code>submitRequirements()</code>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * are used to pass the user credentials for authentication by the plugin
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * modules,<code>getStatus()</code> returns the authentication status.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * <p>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * It should be serializable as a requirement to be stored in HttpSession.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
91cb2bef1c88e70b5d433c2a34bca110a35786ceMark Craig * @supported.api
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
0503f9abf9d0469a149d3aa0d009409f328a6e59Phill Cunningtonpublic final class AuthContextLocal extends Object
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster implements java.io.Serializable {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /*
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Protected variables used locally
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // Debug & I18N class
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster private static final String amAuthContextLocal = "amAuthContextLocal";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Hold the debug instance
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster protected static Debug authDebug = Debug.getInstance(amAuthContextLocal);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Holds the locale-specific information
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster protected static ResourceBundle bundle =
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Locale.getInstallResourceBundle(amAuthContextLocal);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Holds organizationName
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster protected String organizationName;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Holds the set of module instance names
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster protected Set moduleInstanceNames;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Holds the index type
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster protected AuthContext.IndexType indexType;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Holds the index name
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster protected String indexName;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Holds the login status
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster protected AuthContext.Status loginStatus;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Holds the host name
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster protected String hostName;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Holds the http session
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster protected HttpSession httpSession;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Holds Single Sign on Token
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster protected SSOToken ssoToken;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * AuthLoginException
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster protected volatile AuthLoginException loginException = null;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Holds call back information
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster protected Callback[] informationRequired = null;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * AuthLoginContext
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public AMLoginContext amlc = null;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Holds LoginStatus
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public LoginStatus ls;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Holds subject
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster protected Subject subject;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * character array for password
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster protected char[] password;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster private LoginState loginState = null;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster private String orgDN = null;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Holds information about submittion of requirements
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster private boolean inSubmitRequirements = false;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Creates <code>AuthContextLocal</code> instance is obtained for a given
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * organization name, or sub organization name. <code>login</code> method is
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * then used to start the authentication process.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param orgName name of the user's organization.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @supported.api
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public AuthContextLocal(String orgName) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster authDebug.message("AuthContextLocal() constructor called");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster organizationName = orgName;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster amlc = new AMLoginContext(this);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (authDebug.messageEnabled()) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster authDebug.message("AMLoginContext object is... " + amlc);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster reset();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Returns authentication module/s instances(or) plugin(s) configured
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * for an organization, or sub-organization that was set during the
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * <code>AuthContext</code> constructor.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return authentication module/s instances (or plugins).
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @throws UnsupportedOperationException if an error occurred.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @supported.api
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public Set getModuleInstanceNames() {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster moduleInstanceNames = amlc.getModuleInstanceNames();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return (moduleInstanceNames);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Starts the login process for the given <code>AuthContextLocal</code>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * object.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @exception AuthLoginException if an error occurred during login.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @supported.api
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public void login() throws AuthLoginException {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster login(null);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Starts the login process for the given <code>AuthContextLocal</code>s
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * object for the given <code>Principal</code> and the user's password.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * This method should be called primarily
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * when the authenticator knows there would no other
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * credentials needed to complete the authentication process.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param principal <code>Principal</code> of the user to be authenticated.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param password password for the user.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @throws AuthLoginException if an error occurred
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * during login.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @supported.api
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public void login(Principal principal, char[] password)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster throws AuthLoginException {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // Make sure principal and password are not null
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (principal == null)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster throw new AuthLoginException(amAuthContextLocal,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster "invalid-username", null);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (password == null)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster throw new AuthLoginException(amAuthContextLocal,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster "invalid-password", null);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // Copy the password
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster this.password = password;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
42a452a9f1193f232b34e7c22706b8fe44207d3dPhill Cunnington login(null, null, principal, password, null);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Start the login process for the <code>AuthContextLocal</code> object
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * identified by the index type and index name.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * The <code>IndexType</code> defines the possible kinds
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * of "objects" or "resources" for which an authentication can
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * be performed. Currently supported index types are
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * users, roles, services (or application), levels and mechanism.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param type authentication index type.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param indexName authentication index name.
42a452a9f1193f232b34e7c22706b8fe44207d3dPhill Cunnington * @throws AuthLoginException if an error occurred
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * during login.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @supported.api
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public void login(AuthContext.IndexType type, String indexName)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster throws AuthLoginException {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (authDebug.messageEnabled()) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster authDebug.message("AuthContextLocal::login() called " +
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster "with IndexType : " + type + " & Indexname : " + indexName);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
42a452a9f1193f232b34e7c22706b8fe44207d3dPhill Cunnington login(type, indexName, null, null, null);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Starts the login process for the given <code>AuthContextLocal</code>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * object for the given <code>Subject</code>.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Refer to JAAS for description on <code>Subject</code>.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param subject <code>Subject</code> of the user to be authenticated.
42a452a9f1193f232b34e7c22706b8fe44207d3dPhill Cunnington * @throws AuthLoginException if an error occurred
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * during login.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @supported.api
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public void login(Subject subject) throws AuthLoginException {
42a452a9f1193f232b34e7c22706b8fe44207d3dPhill Cunnington login(null, null, null, null, subject);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Starts the login process for the given <code>AuthContextLocal</code>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * object identified by the index type and index name.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * The <code>IndexType</code> defines the possible kinds
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * of "objects" or "resources" for which an authentication can
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * be performed.Currently supported index types are
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * users, roles, services (or application), levels and mechanism.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * The locale specifies the user preferred locale setting.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param type authentication index type.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param indexName authentication index name.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param locale locale setting.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @throws AuthLoginException if an error occurred during
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * login process.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public void login(
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster AuthContext.IndexType type,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String indexName,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String locale
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ) throws AuthLoginException {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (authDebug.messageEnabled()) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster authDebug.message("AuthContextLocal::login() called " +
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster "with IndexType : " + type + " & Indexname : " + indexName +
42a452a9f1193f232b34e7c22706b8fe44207d3dPhill Cunnington " & locale : " + locale);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
42a452a9f1193f232b34e7c22706b8fe44207d3dPhill Cunnington login(type, indexName, null, null, null, null, locale);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Starts the login process for the given <code>AuthContextLocal</code>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * object identified by the index type and index name.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * The <code>IndexType</code> defines the possible kinds
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * of "objects" or "resources" for which an authentication can
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * be performed.Currently supported index types are
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * users, roles, services (or application), levels and mechanism.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * The locale specifies the user preferred locale setting.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param type authentication index type.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param indexName authentication index name.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param envMap Environment Map, key is String, value is set of string.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * this is applicable only when the type is
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * <code>AuthContext.IndexType.RESOURCE</code>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param locale locale setting.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @throws AuthLoginException if an error occurred during
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * login process.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public void login(
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster AuthContext.IndexType type,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String indexName,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Map envMap,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String locale
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ) throws AuthLoginException {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (authDebug.messageEnabled()) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster authDebug.message("AuthContextLocal::login() called " +
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster "with IndexType : " + type + " & Indexname : " + indexName +
42a452a9f1193f232b34e7c22706b8fe44207d3dPhill Cunnington " & locale : " + locale +
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster " & envMap : " + envMap);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
42a452a9f1193f232b34e7c22706b8fe44207d3dPhill Cunnington login(type, indexName, null, null, null, envMap, locale);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Performs the Login for the given AuthContext
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param type authentication index type
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param indexName authentication index name
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param principal principal name of the user to be authenticated
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param password password for the user
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param subject authentication subject
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @throws AuthLoginException if error occurs during login
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster protected void login(AuthContext.IndexType type, String indexName,
42a452a9f1193f232b34e7c22706b8fe44207d3dPhill Cunnington Principal principal, char[] password, Subject subject) throws AuthLoginException {
42a452a9f1193f232b34e7c22706b8fe44207d3dPhill Cunnington login(type, indexName, principal, password, subject, null, null);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Performs the Login for the given AuthContext
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param type authentication index type
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param indexName authentication index name
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param principal principal name of the user to be authenticated
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param password password for the user
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param subject authentication subject
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param envMap Environment map, this is applicable only when the type
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * is <code>AuthContext.IndexType.RESOURCE</code>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param locale locale setting
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @throws AuthLoginException if error occurs during login
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster protected void login(AuthContext.IndexType type, String indexName,
42a452a9f1193f232b34e7c22706b8fe44207d3dPhill Cunnington Principal principal, char[] password, Subject subject, Map envMap, String locale)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster throws AuthLoginException {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster try {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /*if (!getStatus().equals(AuthContext.Status.NOT_STARTED)) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (authDebug.messageEnabled()) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster authDebug.message("AuthContextLocal::login called " +
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster "when the current login status is : " + getStatus());
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster throw new AuthLoginException(amAuthContextLocal,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster "invalidMethod", new Object[]{getStatus()});
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }*/
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // switch the login status
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster loginStatus = AuthContext.Status.IN_PROGRESS;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String redirectUrl = null;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // specially processing for resouce/IP/Environement based auth
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if ((type != null) && type.equals(AuthContext.IndexType.RESOURCE)) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // this is resouce/IP/Env based authentication
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // call Policy Decision Util to find out the actual auth type
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // required by policy
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster List result = Collections.EMPTY_LIST;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster try {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster result = PolicyDecisionUtils.doResourceIPEnvAuth(
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster indexName, organizationName, envMap);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster } catch (PolicyException pe) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // ignore, continue to default realm based authentication
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // may need to revisit this in the future
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster authDebug.warning("AuthContextLocal.login() policy error " +
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster "indexName=" + indexName, pe);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster type = null;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster indexName = null;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (authDebug.messageEnabled()) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster authDebug.message("AuthContextLocal.login: policy decision="
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster + result);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (result.size() == 2) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster type = (AuthContext.IndexType) result.get(0);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster indexName = (String) result.get(1);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster } else if (result.size() == 1) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // this is the redirection case (Policy Redirection Advice)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster redirectUrl = (String) result.get(0);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // append goto parameter for federation case
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Set tmp = (Set) envMap.get(ISAuthConstants.GOTO_PARAM);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if ((tmp != null) && !tmp.isEmpty()) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String gotoParam = (String) tmp.iterator().next();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if ((gotoParam != null) && (gotoParam.length() != 0)) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if ((redirectUrl != null) &&
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster (redirectUrl.indexOf("?") != -1)) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster redirectUrl = redirectUrl + "&" +
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ISAuthConstants.GOTO_PARAM + "=" +
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster URLEncDec.encode(gotoParam);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster } else {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster redirectUrl = redirectUrl + "?" +
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ISAuthConstants.GOTO_PARAM + "=" +
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster URLEncDec.encode(gotoParam);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster type = null;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster indexName = null;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster } else {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // no policy decision, use default realm login
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster type = null;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster indexName = null;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster HashMap loginParamsMap = new HashMap();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster loginParamsMap.put(INDEX_TYPE, type);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster loginParamsMap.put(INDEX_NAME, indexName);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster loginParamsMap.put(PRINCIPAL, principal);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster loginParamsMap.put(PASSWORD, password);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster loginParamsMap.put(SUBJECT, subject);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster loginParamsMap.put(LOCALE, locale);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (redirectUrl != null) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster loginParamsMap.put(REDIRECT_URL, redirectUrl);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (authDebug.messageEnabled()) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster authDebug.message(
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster "loginParamsMap : " + loginParamsMap.toString());
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster authDebug.message("calling AMLoginContext::exceuteLogin : ");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster amlc.executeLogin(loginParamsMap);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster authDebug.message("after AMLoginContext::exceuteLogin : ");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (amlc.getStatus() == LoginStatus.AUTH_SUCCESS) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster loginStatus = AuthContext.Status.SUCCESS;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster } else if (amlc.getStatus() == LoginStatus.AUTH_FAILED) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster loginStatus = AuthContext.Status.FAILED;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (authDebug.messageEnabled()) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster authDebug.message(
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster "Status at the end of login() : " + loginStatus);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster } catch (AuthLoginException e) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (authDebug.messageEnabled()) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster authDebug.message("Exception in ac.login : " + e.toString());
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster throw e;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Resets this instance of <code>AuthContextLocal</code>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * object, so that a new login process can be initiated.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * A new authentication process can started using any
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * one of the <code>login</code> methods.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public void reset() {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster authDebug.message("AuthContextLocal::reset() called");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster loginStatus = AuthContext.Status.NOT_STARTED;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster informationRequired = null;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster loginException = null;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Returns the set of Principals the user has been authenticated as.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * This should be invoked only after successful authentication.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * If the authentication fails or the authentication is in process,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * this will return <code>null</code>.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return The set of Principals the user has been authenticated as.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @supported.api
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public Subject getSubject() {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (!loginStatus.equals(AuthContext.Status.SUCCESS)) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return (null);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (subject == null) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster subject = amlc.getSubject();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return (subject);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Checks if the login process requires more information from the user to
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * complete the authentication.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return <code>true</code> if more credentials are required
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * from the user.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @supported.api
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public boolean hasMoreRequirements() {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster authDebug.message("AuthContextLocal::hasMoreRequirements()");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if ((amlc.getStatus() == LoginStatus.AUTH_SUCCESS) ||
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster (amlc.getStatus() == LoginStatus.AUTH_FAILED)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return false;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster } else {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster informationRequired = amlc.getRequiredInfo();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return (informationRequired != null);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Checks if the login process requires more information from the user to
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * complete the authentication
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param noFilter falg to indicate if there is a Filter
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return <code>true</code> if more credentials are required
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * from the user.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public boolean hasMoreRequirements(boolean noFilter) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster authDebug.message("AuthContextLocal::hasMoreRequirements()");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if ((amlc.getStatus() == LoginStatus.AUTH_SUCCESS) ||
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster (amlc.getStatus() == LoginStatus.AUTH_FAILED)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return false;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster } else {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster informationRequired = amlc.getRequiredInfo();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return (getCallbacks(informationRequired, noFilter) != null);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Returns an array of <code>Callback</code> objects that
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * must be populated by the user and returned back.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * These objects are requested by the authentication plug-ins,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * and these are usually displayed to the user. The user then provides
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * the requested information for it to be authenticated.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return an array of <code>Callback</code> objects requesting credentials
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * from user.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @supported.api
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public Callback[] getRequirements() {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster authDebug.message("AuthContextLocal::getRequirements()");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if ((amlc.getStatus() == LoginStatus.AUTH_SUCCESS) ||
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster (amlc.getStatus() == LoginStatus.AUTH_FAILED)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return null;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster } else {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return (informationRequired);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Returns an array of <code>Callback</code> objects that
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * must be populated by the user and returned back.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * These objects are requested by the authentication plug-ins,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * and these are usually displayed to the user. The user then provides
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * the requested information for it to be authenticated.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param noFilter flag to indicate if there is a Filter
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return an array of <code>Callback</code> objects requesting credentials
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * from user.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @supported.api
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public Callback[] getRequirements(boolean noFilter) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster authDebug.message("AuthContextLocal::getRequirements()");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if ((amlc.getStatus() == LoginStatus.AUTH_SUCCESS) ||
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster (amlc.getStatus() == LoginStatus.AUTH_FAILED)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return null;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster } else {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return (getCallbacks(informationRequired, noFilter));
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Submit the populated <code>Callback</code> objects
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * to the authentication plug-in modules. Called after
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * <code>getRequirements</code> method and obtaining
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * user's response to these requests.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param info array of <code>Callback</code> objects
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @supported.api
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public void submitRequirements(Callback[] info) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster authDebug.message("AuthContextLocal::submitRequirements()");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster inSubmitRequirements = true;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster try{
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster informationRequired = null;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster amlc.submitRequiredInfo(info) ;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (!amlc.isPureJAAS()) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster amlc.runLogin();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (amlc.getStatus() == LoginStatus.AUTH_SUCCESS) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster loginStatus = AuthContext.Status.SUCCESS;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster } else if (amlc.getStatus() == LoginStatus.AUTH_FAILED) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster loginStatus = AuthContext.Status.FAILED;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster authDebug.message("AuthContextLocal::submitRequirements end");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (authDebug.messageEnabled()) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster authDebug.message("Status at the end of submitRequirements() : "
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster + loginStatus);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster } finally {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster inSubmitRequirements = false;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Logs out the user and also invalidates the <code>SSOToken</code>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * associated with this <code>AuthContextLocal</code>.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @throws AuthLoginException if an error occurred during logout
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @supported.api
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public void logout() throws AuthLoginException {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster authDebug.message("AuthContextLocal::logout()");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster try {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster amlc.logout();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster } catch (Exception e) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (authDebug.messageEnabled()) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster authDebug.message("Exception in AMLoginContext::logout() "
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster + e.getMessage());
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster throw new AuthLoginException(amAuthContextLocal, "logoutError",
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster null, e);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster authDebug.message("Called AMLoginContext::logout()");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster loginStatus = AuthContext.Status.COMPLETED;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Returns login exception, if any, during
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * the authentication process. Typically set when the login
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * fails.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return login exception.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @supported.api
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public AuthLoginException getLoginException() {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster authDebug.message("AuthContextLocal::getLoginException()");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return (loginException);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Sets the login exception that represents errors during the
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * authentication process.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param exception AuthLoginException to be set.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public void setLoginException(AuthLoginException exception) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster loginException = exception;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Returns the current status of the authentication process.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return the current status of the authentication process.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @supported.api
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public AuthContext.Status getStatus() {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster authDebug.message("AuthContextLocal::getStatus()");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (amlc.getStatus() == LoginStatus.AUTH_SUCCESS) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster loginStatus = AuthContext.Status.SUCCESS;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster else if (amlc.getStatus() == LoginStatus.AUTH_FAILED) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster loginStatus = AuthContext.Status.FAILED;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster else if (amlc.getStatus() == LoginStatus.AUTH_RESET) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster loginStatus = AuthContext.Status.RESET;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster else if (amlc.getStatus() == LoginStatus.AUTH_ORG_MISMATCH) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster loginStatus = AuthContext.Status.ORG_MISMATCH;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster else if (amlc.getStatus() == LoginStatus.AUTH_IN_PROGRESS) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster loginStatus = AuthContext.Status.IN_PROGRESS;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster else if (amlc.getStatus() == LoginStatus.AUTH_COMPLETED) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster loginStatus = AuthContext.Status.COMPLETED;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (authDebug.messageEnabled()) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster authDebug.message("AuthContextLocal:: Status : " + loginStatus);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return (loginStatus);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Sets the login status. Used internally and
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * not visible outside this package.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param status login status
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster protected void setLoginStatus(AuthContext.Status status) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster authDebug.message("AuthContextLocal::setLoginStatus()");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster loginStatus = status;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Returns the Single-Sign-On (SSO) Token for the authenticated
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * user.Single-Sign-On token can be used as the authenticated token.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return single-sign-on token
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @supported.api
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public SSOToken getSSOToken() {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ssoToken = amlc.getSSOToken();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return (ssoToken);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Returns the Successful Login URL for the authenticated user.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return the Successful Login URL for the authenticated user.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public String getSuccessURL() {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return amlc.getSuccessURL();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Returns the Failure Login URL for the authenticating user.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return the Failure Login URL for the authenticating user.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public String getFailureURL() {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return amlc.getFailureURL();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Returns the the organization name that was set during the
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * <code>AuthContextLocal</code> constructor.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return Organization name.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @supported.api
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public String getOrganizationName() {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return (amlc.getOrganizationName());
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Terminates an ongoing <code>login</code> call that has not yet completed.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @throws AuthLoginException if an error occurred during abort.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @supported.api
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public void abort() throws AuthLoginException {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster authDebug.message("AuthContextLocal::abort()");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster try {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster amlc.abort();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster } catch (Exception e) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (authDebug.messageEnabled()) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster authDebug.message("Exception in AMLoginContext::abort() "
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster + e.getMessage());
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster throw new AuthLoginException(amAuthContextLocal, "abortError",
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster null, e);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster loginStatus = AuthContext.Status.COMPLETED;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Returns the error template.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return the error template.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public String getErrorTemplate() {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return amlc.getErrorTemplate();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Returns the error message.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return the error message.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public String getErrorMessage() {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return amlc.getErrorMessage();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Returns the error code.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return error code.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public String getErrorCode() {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return amlc.getErrorCode();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Returns the current 'authIdentifier' of the authentication process as
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * String Session ID.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return <code>authIdentifier</code> of the authentication process
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public String getAuthIdentifier() {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return amlc.getAuthIdentifier();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Returns the account lockout message. This can be either a dynamic
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * message indicating the number of tries left or the the account
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * deactivated message.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return account lockout message.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public String getLockoutMsg() {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String lockoutMsg = amlc.getLockoutMsg();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (authDebug.messageEnabled()) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster authDebug.message("getLockoutMsg: lockoutMsg: " + lockoutMsg);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return lockoutMsg;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Checks the account is locked out
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return <code>true</code> if the account is locked,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * <code>false</code> otherwise
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public boolean isLockedOut() {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster boolean isLockedOut = amlc.isLockedOut();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (authDebug.messageEnabled()) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster authDebug.message("isLockedOut : " + isLockedOut);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return isLockedOut;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Sets the client's host name , this method is used in case of remote
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * authentication,to set the client's hostname or IP address.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * This could be used by the policy component to restrict access
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * to resources.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param hostname Host name.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public void setClientHostName(String hostname) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster hostName = hostname;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Returns the clients host name
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return hostname
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster protected String getClientHostName() {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return (hostName);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public boolean submittedRequirements() {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return inSubmitRequirements;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Sets the <code>HttpSession</code> that will be used by
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * the SSO component to store the session information. In the
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * absence of <code>HttpSession</code> the information is stored
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * in <code>HashMap</code> and will have issues with fail-over.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * With session fail-over turned on <code>HttpSession</code>
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * would be provide persistance storage mechanism for SSO.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster *
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param session HttpSession
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public void setHttpSession(HttpSession session) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster httpSession = session;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Returns the <code>HTTPSession</code> associated with the current
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * authentication context
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return httpSession
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster protected HttpSession getHttpSession() {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return (httpSession);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Returns the array of <code>Callback</code> requirements objects
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param recdCallbacks callbacks requirements
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param noFilter boolean to indicate if filter exists
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return an array of <code>Callback</code> objects
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster protected static Callback[] getCallbacks(
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Callback[] recdCallbacks,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster boolean noFilter) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (recdCallbacks == null) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return (null);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster } else if (noFilter) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return recdCallbacks;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster } else {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Callback[] answer = new Callback[0];
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ArrayList callbackList= new ArrayList();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster for (int i = 0; i < recdCallbacks.length; i++) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (authDebug.messageEnabled()) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster authDebug.message("In getCallbacks() callback : "
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster + recdCallbacks[i]);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (!(recdCallbacks[i] instanceof PagePropertiesCallback)) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster callbackList.add(recdCallbacks[i]);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return (Callback[]) callbackList.toArray(answer);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Sets the Login State
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param state login state
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public void setLoginState(LoginState state) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster loginState = state;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Returns the login state
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return loginState
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public LoginState getLoginState() {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return loginState;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Sets the Organization DN
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param orgDN Organization DN
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public void setOrgDN(String orgDN) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster this.orgDN = orgDN;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Returns the Organization DN
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return the Organization DN
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public String getOrgDN() {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return orgDN;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster }
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Holds LDAP URL
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public final static String LDAP_AUTH_URL = "ldap://";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Holds principal name to be authenticated
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public final static String PRINCIPAL = "principal";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Holds Password for the user
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public final static String PASSWORD = "password";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * authentication subject
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public final static String SUBJECT = "subject";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * authentication index type
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public final static String INDEX_TYPE = "indexType";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * authentication index name
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public final static String INDEX_NAME = "indexName";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * locale setting
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public final static String LOCALE = "locale";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster /**
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Redirection URL
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static final String REDIRECT_URL = "redirectionURL";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster}