Package jrun.servlet.security

Examples of jrun.servlet.security.AuthenticatedUser


            start(FlexContext.getServletConfig());
        }

        try
        {
            AuthenticatedUser user = null;
            String password = extractPassword(credentials);

            if (password != null)
            {
                // Test for the presence of a response here (rather than request) because NIO
                // endpoints require the alternate code path and they don't populate the response
                // in FlexContext.
                HttpServletResponse response = FlexContext.getHttpResponse();
                if (response != null)
                {
                    HttpServletRequest request = FlexContext.getHttpRequest();
                    user = appSecurity.authenticate(username, password, request.getSession(true));
                }
                else
                {
                    ServletContext servletContext = FlexContext.getServletConfig().getServletContext();
                    WebApplication webApp = ((jrun.servlet.JRunServletContext)servletContext).getWebApplication();
                    HttpSession tempSession = webApp.getSessionService().createSession("temp");
                    user = appSecurity.authenticate(username, password, tempSession);
                    tempSession.invalidate();
                }
                return user.getPrincipal();
            }
        }
        catch (Exception ex)
        {
            SecurityException se;
View Full Code Here


                WebApplication webApp = ((jrun.servlet.JRunServletContext)servletContext).getWebApplication();
                HttpServletRequest request = FlexContext.getHttpRequest();
       
                HttpSession session = request.getSession();
                String sessionId = session.getId();
                AuthenticatedUser currentUser = usersService.getUser(sessionId, webApp);
                currentUser.logoff();
            }
            catch (NullPointerException npe)
            {
            }
        }
View Full Code Here

            start(FlexContext.getServletConfig());
        }

        try
        {
            AuthenticatedUser user = null;
            String password = extractPassword(credentials);

            if (password != null)
            {
                HttpServletRequest request = FlexContext.getHttpRequest();
                if (request != null)
                {
                    user = appSecurity.authenticate(username, password, request.getSession(true));
                }
                else
                {
                  ServletContext servletContext = FlexContext.getServletConfig().getServletContext();
                    WebApplication webApp = ((jrun.servlet.JRunServletContext)servletContext).getWebApplication();
                    HttpSession tempSession = webApp.getSessionService().createSession("temp");
                    user = appSecurity.authenticate(username, password, tempSession);
                    tempSession.invalidate();
                }
                return user.getPrincipal();
            }
        }
        catch (Exception ex)
        {
          SecurityException se;
View Full Code Here

            WebApplication webApp = ((jrun.servlet.JRunServletContext)servletContext).getWebApplication();
            HttpServletRequest request = FlexContext.getHttpRequest();

            HttpSession session = request.getSession();
            String sessionId = session.getId();
            AuthenticatedUser currentUser = usersService.getUser(sessionId, webApp);
            currentUser.logoff();

            return true;
        }
        catch (NullPointerException npe)
        {
View Full Code Here

TOP

Related Classes of jrun.servlet.security.AuthenticatedUser

Copyright © 2018 www.massapicom. 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.