Package org.eclipse.jetty.server

Examples of org.eclipse.jetty.server.UserIdentity$UnauthenticatedUserIdentity


    // "login" is copied without changes from FormAuthenticator
    @Override
    public UserIdentity login(String username, Object password, ServletRequest request)
    {

        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);
View Full Code Here


    // "login" is copied without changes from FormAuthenticator
    @Override
    public UserIdentity login(String username, Object password, ServletRequest request)
    {

        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);
View Full Code Here

    // "login" is copied without changes from FormAuthenticator
    @Override
    public UserIdentity login(String username, Object password, ServletRequest request)
    {

        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);
View Full Code Here

    // "login" is copied without changes from FormAuthenticator
    @Override
    public UserIdentity login(String username, Object password, ServletRequest request)
    {

        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);
View Full Code Here

    // "login" is copied without changes from FormAuthenticator
    @Override
    public UserIdentity login(String username, Object password, ServletRequest request)
    {

        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);
View Full Code Here

    // "login" is copied without changes from FormAuthenticator
    @Override
    public UserIdentity login(String username, Object password, ServletRequest request)
    {

        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);
View Full Code Here

    // "login" is copied without changes from FormAuthenticator
    @Override
    public UserIdentity login(String username, Object password, ServletRequest request)
    {

        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);
View Full Code Here

   }

   @Override
   public UserIdentity login(final String username, Object credentials)
   {
      UserIdentity identity = identities.get(username);
      if (identity == null)
      {
         if (validUsers.containsKey(username) && validUsers.get(username).equals(credentials))
         {
            Principal userPrincipal = new Principal()
View Full Code Here

                            contextName = "/";
                        }
                        FederationContext fedConfig = getContextConfiguration(contextName);
                       
                        FederationLoginService fedLoginService = (FederationLoginService)this._loginService;
                        UserIdentity user = fedLoginService.login(null, wfReq, fedConfig);
                        if (user != null)
                        {
                            session=renewSession(request,response);
                           
                            FederationUserIdentity  fui = (FederationUserIdentity)user;
                            session.setAttribute(SECURITY_TOKEN_ATTR, fui.getToken());

                            // Redirect to original request
                            String nuri;
                            synchronized(session)
                            {
                                nuri = (String) session.getAttribute(J_URI);

                                if (nuri == null || nuri.length() == 0)
                                {
                                    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);
                        }
View Full Code Here

                            contextName = "/";
                        }
                        FederationContext fedConfig = getContextConfiguration(contextName);
                       
                        FederationLoginService fedLoginService = (FederationLoginService)this._loginService;
                        UserIdentity user = fedLoginService.login(null, wfReq, fedConfig);
                        if (user != null)
                        {
                            session=renewSession(request,response);
                           
                            FederationUserIdentity  fui = (FederationUserIdentity)user;
                            session.setAttribute(SECURITY_TOKEN_ATTR, fui.getToken());

                            // Redirect to original request
                            String nuri;
                            synchronized(session)
                            {
                                nuri = (String) session.getAttribute(J_URI);

                                if (nuri == null || nuri.length() == 0)
                                {
                                    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);
                        }
View Full Code Here

TOP

Related Classes of org.eclipse.jetty.server.UserIdentity$UnauthenticatedUserIdentity

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.