Package org.eclipse.jetty.security

Examples of org.eclipse.jetty.security.UserAuthentication


                HttpSession session = ((HttpServletRequest)messageInfo.getRequestMessage()).getSession(false);
                Authentication cached = (session == null?null:(SessionAuthentication)session.getAttribute(SessionAuthentication.__J_AUTHENTICATED));
                if (cached != null)
                    return cached;
               
                return new UserAuthentication(getAuthMethod(), userIdentity);
            }
            if (authStatus == AuthStatus.SEND_SUCCESS)
            {
                // we are processing a message in a secureResponse dialog.
                return Authentication.SEND_SUCCESS;
View Full Code Here


                    UserIdentity user = _loginService.login(username,credential);
                    if (user!=null)
                    {
                        renewSessionOnAuthentication(request,response);
                        return new UserAuthentication(getAuthMethod(),user);
                    }
                }
            }
               
            if (!_deferred.isDeferred(response))
View Full Code Here

                {
                    UserIdentity user = _loginService.login(digest.username,digest);
                    if (user!=null)
                    {
                        renewSessionOnAuthentication(request,response);
                        return new UserAuthentication(getAuthMethod(),user);
                    }
                }
                else if (n == 0)
                    stale = true;
View Full Code Here

           
            UserIdentity user = _loginService.login(null,spnegoToken);
           
            if ( user != null )
            {
                return new UserAuthentication(getAuthMethod(),user);
            }
        }
       
        return Authentication.UNAUTHENTICATED;
    }
View Full Code Here

        if (_loginService!=null)
        {
            UserIdentity user = _loginService.login(username,password);
            if (user!=null)
            {
                UserAuthentication authentication = new UserAuthentication("API",user);
                if (_identityService!=null)
                    _previousAssociation=_identityService.associate(user);
                return authentication;
            }
        }
View Full Code Here

                            UserIdentity user = _loginService.login(username,password);
                            if (user!=null)
                            {
                                renewSessionOnAuthentication(request,response);
                                return new UserAuthentication(getAuthMethod(),user);
                            }
                        }
                    }
                }
            }
View Full Code Here

//            final ServletCallbackHandler callbackHandler = new ServletCallbackHandler(loginService);
            final Subject subject = new Subject();
            final AccessControlContext acc = ContextManager.registerSubjectShort(subject, null, null);
            securityHandlerFactory = new ServerAuthenticationGBean(new Authenticator() {
                public Authentication validateRequest(ServletRequest request, ServletResponse response, boolean mandatory) throws ServerAuthException {
                    return new UserAuthentication(this, new GeronimoUserIdentity(subject, new GeronimoUserPrincipal("foo"), acc));
                }// most likely validatedUser is not needed here.

                public boolean secureResponse(ServletRequest request, ServletResponse response, boolean mandatory, Authentication.User validatedUser) throws ServerAuthException {
                    return true;
                }
View Full Code Here

      assertThat(authenticate()).isInstanceOf(UserAuthentication.class);
    }
   
    @Test
    public void itCreatesAWesabeUserInstance() throws Exception {
      final UserAuthentication auth = (UserAuthentication) authenticate();
      assertThat(auth.getUserIdentity().getUserPrincipal()).isInstanceOf(WesabeUser.class);
     
      final WesabeUser user = (WesabeUser) auth.getUserIdentity().getUserPrincipal();
      assertThat(user.getUserId()).isEqualTo(20);
      assertThat(user.getAccountKey()).isEqualTo("f6078ebe0c2f08c225c0349aef2fe062d71b972e3c91b9687cccdff24d0c8acd");
    }
View Full Code Here

          final String username = credentials.substring(0, i);
          final String password = credentials.substring(i + 1);

          final UserIdentity user = WesabeUser.create(username, password);
          if (user != null) {
            return new UserAuthentication(this, user);
          }
        }
      } catch (IllegalArgumentException e) {
        // fall through to sending an auth challenge
      } catch (StringIndexOutOfBoundsException e) {
View Full Code Here

            Subject theSubject = new Subject();
            String[] theRoles = new String[roles.size()];
            roles.toArray(theRoles);

            UserIdentity userIdentity = new DefaultUserIdentity(theSubject, principal, theRoles);
            authentication = new UserAuthentication(getAuthMethod(), userIdentity);
            request.setAuthentication(authentication);
        }
        return authentication;
    }
View Full Code Here

TOP

Related Classes of org.eclipse.jetty.security.UserAuthentication

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.