Examples of LoginManager


Examples of bg.smoc.model.manager.LoginManager

      throws ServletException, IOException {
    String login = extractRequestParam(request, "id");
    String password = extractRequestParam(request, "password");
    String clientIP = request.getRemoteAddr();

    LoginManager loginManager = SessionUtil.getInstance().getLoginManager();
    if (loginManager.isLoginValid(login, password, clientIP)) {
      loginManager.initiateSession(request, login);
      response.sendRedirect("chooseContest");
    } else {
      loginManager.finalizeSession(request);
      response.setContentType("text/html");
      response.getOutputStream().println("<script language=\"javascript\">"
          + "alert(\"Login Failed\");"
          + "history.go(-1);"
          + "</script>");
View Full Code Here

Examples of bg.smoc.model.manager.LoginManager

     * UserAccountManager, LoginManager, ContestManager, PersonManager and
     * GraderManager.
     */
    private void setUpManagers() {
        userAccountManager = new UserAccountManager(userAccountSerializer);
        loginManager = new LoginManager();
        personManager = new PersonManager(personSerializer);
        graderManager = new GraderManager(gradingPort, workingDirectory);
        contestManager = new ContestManager(workingDirectory, contestSerializer);
        printManager = new PrintManager(workingDirectory);
       
View Full Code Here

Examples of flex.messaging.security.LoginManager

        return null;
    }

    public Object serviceCommand(CommandMessage msg)
    {
        LoginManager lm = getMessageBroker().getLoginManager();
        switch (msg.getOperation())
        {
            case CommandMessage.LOGIN_OPERATION:
                if (msg.getBody() instanceof String)
                {
                    String encoded = (String)msg.getBody();
                    Object charsetHeader = msg.getHeader(CommandMessage.CREDENTIALS_CHARSET_HEADER);
                    if (charsetHeader instanceof String)
                        decodeAndLoginWithCharset(encoded, lm, (String)charsetHeader);
                    else
                        decodeAndLoginWithCharset(encoded, lm, null);
                }
                break;
            case CommandMessage.LOGOUT_OPERATION:
                lm.logout();
                break;
            default:
                throw new MessageException("Service Does Not Support Command Type " + msg.getOperation());
        }
        return "success";
View Full Code Here

Examples of flex.messaging.security.LoginManager

        broker.setRedeployManager(redeployManager);
    }

    private void createAuthorizationManager(MessageBroker broker)
    {
        LoginManager loginManager = new LoginManager();

        // Create a Login Command for the LoginManager.
        LoginCommand loginCommand = null;

        Map loginCommands = securitySettings.getLoginCommands();

        // If default Login Command is enabled, use it.
        LoginCommandSettings loginCommandSettings = (LoginCommandSettings)loginCommands.get(LoginCommandSettings.SERVER_MATCH_OVERRIDE);
        if (loginCommandSettings != null)
        {
            loginCommand = initLoginCommand(loginCommandSettings);
        }
        // Otherwise, try a server specific Login Command.
        else
        {
            String serverInfo = securitySettings.getServerInfo();
            loginCommandSettings = (LoginCommandSettings)loginCommands.get(serverInfo);

            if (loginCommandSettings != null)
            {
                loginCommand = initLoginCommand(loginCommandSettings);
            }
            else
            {
                // Try a partial match of serverInfo
                serverInfo = serverInfo.toLowerCase();
                for (Iterator iterator = loginCommands.keySet().iterator(); iterator.hasNext();)
                {
                    String serverMatch = (String)iterator.next();
                    loginCommandSettings = (LoginCommandSettings)loginCommands.get(serverMatch);

                    if (serverInfo.indexOf(serverMatch.toLowerCase()) != -1)
                    {
                        // add this match for easier lookup next time around
                        loginCommands.put(serverInfo, loginCommandSettings);
                        loginCommand = initLoginCommand(loginCommandSettings);
                        break;
                    }
                }
            }
        }

        if (loginCommand == null)
        {
            if (Log.isWarn())
                Log.getLogger(ConfigurationManager.LOG_CATEGORY).warn
                ("No login command was found for '" + securitySettings.getServerInfo()
                        + "'. Please ensure that the login-command tag has the correct server attribute value"
                        + ", or use 'all' to use the login command regardless of the server.");
        }
        else
        {
            loginManager.setLoginCommand(loginCommand);
        }

        if (loginCommandSettings != null)
            loginManager.setPerClientAuthentication(loginCommandSettings.isPerClientAuthentication());

        broker.setLoginManager(loginManager);
    }
View Full Code Here

Examples of flex.messaging.security.LoginManager

        broker.setRedeployManager(redeployManager);
    }

    private void createAuthorizationManager(MessageBroker broker)
    {              
        LoginManager loginManager = new LoginManager();
           
        // Create a LoginCommand for the LoginManager.
        LoginCommand loginCommand = null;
       
        Map loginCommands = securitySettings.getLoginCommands();
       
        // If default Login Command is enabled, use it.
        LoginCommandSettings loginCommandSettings = (LoginCommandSettings)loginCommands.get(LoginCommandSettings.SERVER_MATCH_OVERRIDE);
        if (loginCommandSettings != null)
        {
            loginCommand = initLoginCommand(loginCommandSettings);
        }
        // Otherwise, try a server specific Login Command.
        else
        {
            String serverInfo = securitySettings.getServerInfo();
            loginCommandSettings = (LoginCommandSettings)loginCommands.get(serverInfo);

            if (loginCommandSettings != null)
            {
                loginCommand = initLoginCommand(loginCommandSettings);
            }
            else
            {
                // Try a partial match of serverInfo
                serverInfo = serverInfo.toLowerCase();
                for (Iterator iterator = loginCommands.keySet().iterator(); iterator.hasNext();)
                {
                    String serverMatch = (String)iterator.next();
                    loginCommandSettings = (LoginCommandSettings)loginCommands.get(serverMatch);

                    if (serverInfo.indexOf(serverMatch.toLowerCase()) != -1)
                    {
                        // add this match for easier lookup next time around
                        loginCommands.put(serverInfo, loginCommandSettings);
                        loginCommand = initLoginCommand(loginCommandSettings);
                        break;
                    }
                }
            }
        }       
        loginManager.setLoginCommand(loginCommand);
       
        if (loginCommandSettings != null)
            loginManager.setPerClientAuthentication(loginCommandSettings.isPerClientAuthentication());

        broker.setLoginManager(loginManager);
    }
View Full Code Here

Examples of flex.messaging.security.LoginManager

        return null;
    }

    public Object serviceCommand(CommandMessage msg)
    {
        LoginManager lm = getMessageBroker().getLoginManager();
        switch (msg.getOperation())
        {
            case CommandMessage.LOGIN_OPERATION:
                if (msg.getBody() instanceof String)
                {
                    String encoded = (String)msg.getBody();
                    Object charsetHeader = msg.getHeader(CommandMessage.CREDENTIALS_CHARSET_HEADER);
                    if (charsetHeader instanceof String)
                        decodeAndLoginWithCharset(encoded, lm, (String)charsetHeader);
                    else
                        decodeAndLoginWithCharset(encoded, lm, null);
                }
                break;
            case CommandMessage.LOGOUT_OPERATION:
                lm.logout();
                break;
            default:
                throw new MessageException("Service Does Not Support Command Type " + msg.getOperation());
        }
        return "success";
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.