All Downloads are FREE. Search and download functionalities are using the official Maven repository.

it.eng.spago.security.xmlauthorizations.XMLAuthenticationHandler Maven / Gradle / Ivy

/**

    Copyright 2004, 2007 Engineering Ingegneria Informatica S.p.A.

    This file is part of Spago.

    Spago is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation; either version 2.1 of the License, or
    any later version.

    Spago is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with Spago; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

**/
package it.eng.spago.security.xmlauthorizations;

import it.eng.spago.base.Constants;
import it.eng.spago.base.SourceBean;
import it.eng.spago.error.EMFInternalError;
import it.eng.spago.security.IAuthenticationHandler;
import it.eng.spago.tracing.TracerSingleton;

/**
 * @author Andrea Zoppello
 *
 * To change this generated comment edit the template variable "typecomment":
 * Window>Preferences>Java>Templates.
 * To enable and disable the creation of type comments go to
 * Window>Preferences>Java>Code Generation.
 */
public class XMLAuthenticationHandler implements IAuthenticationHandler {
    public static final String USER_ID = "userID";

    public XMLAuthenticationHandler() {
        super();
    } // public XMLAuthenticationHandler()

    /**
     * @see it.eng.spago.security.actions.IAuthenticatorHandler#authenticate(it.eng.spago.base.SourceBean, it.eng.spago.base.SourceBean)
     */
    public Object authenticate(SourceBean request, SourceBean response) throws EMFInternalError {
        String userID = (String)request.getAttribute(IAuthenticationHandler.USER_ID_TAG);
        String password = (String)request.getAttribute(IAuthenticationHandler.PASSWORD_TAG);
        TracerSingleton.log(Constants.NOME_MODULO, TracerSingleton.DEBUG,
            "XMLAuthenticationHandler::authenticate: userID [" + userID + "]");
        XMLAuthorizationsRepository.getInstance().authenticateUser(userID, password);
        return userID;
    } // public Object authenticate(SourceBean request, SourceBean response) throws EMFInternalError
} // public class XMLAuthenticationHandler implements IAuthenticationHandler




© 2015 - 2025 Weber Informatics LLC | Privacy Policy