Package org.eclipse.jetty.server

Examples of org.eclipse.jetty.server.Authentication$SendSuccess


        UserIdentity user = super.login(username,password,request);
        if (user!=null)
        {
            HttpSession session = ((HttpServletRequest)request).getSession(true);
            Authentication cached=new SessionAuthentication(getAuthMethod(),user,password);
            session.setAttribute(SessionAuthentication.__J_AUTHENTICATED, cached);
        }
        return user;
    }
View Full Code Here


        // ++ copied from FormAuthenticator

        HttpSession session = request.getSession(true);

        // Look for cached authentication
        Authentication authentication = (Authentication) session.getAttribute(SessionAuthentication.__J_AUTHENTICATED);
        if (authentication != null)
        {
            // Has authentication been revoked?
            if (authentication instanceof Authentication.User &&
                _loginService!=null &&
View Full Code Here

        UserIdentity user = super.login(username,password,request);
        if (user!=null)
        {
            HttpSession session = ((HttpServletRequest)request).getSession(true);
            Authentication cached=new SessionAuthentication(getAuthMethod(),user,password);
            session.setAttribute(SessionAuthentication.__J_AUTHENTICATED, cached);
        }
        return user;
    }
View Full Code Here

        // ++ copied from FormAuthenticator

        HttpSession session = request.getSession(true);

        // Look for cached authentication
        Authentication authentication = (Authentication) session.getAttribute(SessionAuthentication.__J_AUTHENTICATED);
        if (authentication != null)
        {
            // Has authentication been revoked?
            if (authentication instanceof Authentication.User &&
                _loginService!=null &&
View Full Code Here

                                    nuri = request.getContextPath();
                                    if (nuri.length() == 0) {
                                        nuri = URIUtil.SLASH;
                                    }
                                }
                                Authentication cached=new SessionAuthentication(getAuthMethod(), user, wfRes);
                                session.setAttribute(SessionAuthentication.__J_AUTHENTICATED, cached);
                            }
                            response.setContentLength(0);  
                            response.sendRedirect(response.encodeRedirectURL(nuri));

                            return new FederationAuthentication(getAuthMethod(), user);
                        }

                        // not authenticated
                        if (LOG.isDebugEnabled()) {
                            LOG.debug("WSFED authentication FAILED for " + StringUtil.printable(user.getUserPrincipal().getName()));
                        }
                        if (response != null) {
                            response.sendError(HttpServletResponse.SC_FORBIDDEN);
                        }

                    }
                } else {
                    LOG.warn("Not supported action found in parameter wa: " + wa);
                    response.sendError(HttpServletResponse.SC_BAD_REQUEST);
                    return Authentication.UNAUTHENTICATED;
                }
            }

            // Look for cached authentication
            Authentication authentication = (Authentication) session.getAttribute(SessionAuthentication.__J_AUTHENTICATED);
            if (authentication != null)
            {
                // Has authentication been revoked?
                if (authentication instanceof Authentication.User &&
                    _loginService!=null &&
View Full Code Here

                                    nuri = request.getContextPath();
                                    if (nuri.length() == 0) {
                                        nuri = URIUtil.SLASH;
                                    }
                                }
                                Authentication cached=new SessionAuthentication(getAuthMethod(), user, wfRes);
                                session.setAttribute(SessionAuthentication.__J_AUTHENTICATED, cached);
                            }
                            response.setContentLength(0);  
                            response.sendRedirect(response.encodeRedirectURL(nuri));

                            return new FederationAuthentication(getAuthMethod(), user);
                        }

                        // not authenticated
                        if (LOG.isDebugEnabled()) {
                            LOG.debug("WSFED authentication FAILED for " + StringUtil.printable(user.getUserPrincipal().getName()));
                        }
                        if (response != null) {
                            response.sendError(HttpServletResponse.SC_FORBIDDEN);
                        }

                    }
                } else {
                    LOG.warn("Not supported action found in parameter wa: " + wa);
                    response.sendError(HttpServletResponse.SC_BAD_REQUEST);
                    return Authentication.UNAUTHENTICATED;
                }
            }

            // Look for cached authentication
            Authentication authentication = (Authentication) session.getAttribute(SessionAuthentication.__J_AUTHENTICATED);
            if (authentication != null)
            {
                // Has authentication been revoked?
                if (authentication instanceof Authentication.User &&
                    _loginService!=null &&
View Full Code Here

        // check if this call is resulting from the redirect after successful authentication.
        // if so, make the authentication successful and continue the original request
        if (saveRestoreRequest && matchRequest(request)) {
            Principal savedPrincipal = (Principal) session.getAttribute(FORM_PRINCIPAL_NOTE);
            List<String> savedRoles = (List<String>) session.getAttribute(FORM_ROLES_NOTE);
            Authentication registeredAuthentication = register(request, savedPrincipal, savedRoles);

            // try to restore the original request (including post data, etc...)
            if (restoreRequest(request, session)) {
                // success! user is authenticated; continue processing original request
                return registeredAuthentication;
View Full Code Here

        }
        HttpSession session = httpServletRequest.getSession(false);
        session.setAttribute(FORM_PRINCIPAL_NOTE, principal);
        session.setAttribute(FORM_ROLES_NOTE, roles);
        Request request = (Request) httpServletRequest;
        Authentication authentication = request.getAuthentication();
        if (!(authentication instanceof UserAuthentication)) {
            Subject theSubject = new Subject();
            String[] theRoles = new String[roles.size()];
            roles.toArray(theRoles);
View Full Code Here

    @Override
    public Authentication authenticate(ServletRequest request)
    {
        try
        {
            Authentication authentication = _authenticator.validateRequest(request,__deferredResponse,true);

            if (authentication!=null && (authentication instanceof Authentication.User) && !(authentication instanceof Authentication.ResponseSent))
            {
                LoginService login_service= _authenticator.getLoginService();
                IdentityService identity_service=login_service.getIdentityService();
View Full Code Here

        try
        {
            LoginService login_service= _authenticator.getLoginService();
            IdentityService identity_service=login_service.getIdentityService();
           
            Authentication authentication = _authenticator.validateRequest(request,response,true);
            if (authentication instanceof Authentication.User && identity_service!=null)
                _previousAssociation=identity_service.associate(((Authentication.User)authentication).getUserIdentity());
            return authentication;
        }
        catch (ServerAuthException e)
View Full Code Here

TOP

Related Classes of org.eclipse.jetty.server.Authentication$SendSuccess

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.