Person person = Person.readPersonByUsername(username); if (person == null) { person = Person.readPersonByIstUsername(username); } if (person != null) { ServiceUtils.executeService(null, "SetUserUID", new Object[] { person } ); }
    public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request,            HttpServletResponse response) throws FenixActionException {        final String username = request.getParameter("username");        final String password = request.getParameter("password");        final String requestURL = request.getRequestURL().toString();        boolean result = false;                      final String remoteHostName = BaseAuthenticationAction.getRemoteHostName(request);        Object argsAutenticacao[] = { username, password, requestURL, remoteHostName };        try {            String scheme = request.getScheme();            if (allowedProtocol.equalsIgnoreCase(scheme)) {                ServiceManagerServiceFactory.executeService(null, "Autenticacao", argsAutenticacao);                result = true;            }        } catch (Exception e) {            result = false;        }        try {            sendAnswer(response, result);        } catch (IOException ex) {            throw new FenixActionException(ex);        }        return null;    }