Package org.eclipse.jetty.server

Examples of org.eclipse.jetty.server.UserIdentity


        Subject subject = new Subject();
        subject.getPrincipals().add(userPrincipal);
        subject.getPrivateCredentials().add(credential);
        subject.setReadOnly();

        UserIdentity identity= _identityService.newUserIdentity(subject, userPrincipal, IdentityService.NO_ROLES);

        return identity;

      }
View Full Code Here


          final int i = credentials.indexOf(CREDENTIAL_DELIMITER);
         
          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) {
View Full Code Here

                _users.clear();
                lastHashPurge = now;
            }
        }

        UserIdentity u = super.login(username, credentials);
        if (u != null) {
            Log.info("authenticating user [{}]", username);
        } else {
            Log.info("did not find user [{}]", username);
        }
View Full Code Here

        if (!(authentication instanceof UserAuthentication)) {
            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

    public Authentication login(String username, Object password, ServletRequest request)
    {
        if (username == null)
            return null;
       
        UserIdentity identity = _authenticator.login(username, password, request);
        if (identity != null)
        {
            IdentityService identity_service = _authenticator.getLoginService().getIdentityService();
            UserAuthentication authentication = new UserAuthentication("API",identity);
            if (identity_service != null)
View Full Code Here

                int n = checkNonce(digest,(Request)request);

                if (n > 0)
                {
                    //UserIdentity user = _loginService.login(digest.username,digest);
                    UserIdentity user = login(digest.username, digest, req);
                    if (user!=null)
                    {
                        return new UserAuthentication(getAuthMethod(),user);
                    }
                }
View Full Code Here

    /* ------------------------------------------------------------ */
    @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

            if (isJSecurityCheck(uri))
            {
                final String username = request.getParameter(__J_USERNAME);
                final String password = request.getParameter(__J_PASSWORD);

                UserIdentity user = login(username, password, request);
                LOG.debug("jsecuritycheck {} {}",username,user);
                session = request.getSession(true);
                if (user!=null)
                {                   
                    // Redirect to original request
View Full Code Here

        }
        else if (header != null && header.startsWith(HttpHeader.NEGOTIATE.asString()))
        {
            String spnegoToken = header.substring(10);

            UserIdentity user = login(null,spnegoToken, request);

            if ( user != null )
            {
                return new UserAuthentication(getAuthMethod(),user);
            }
View Full Code Here

TOP

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

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.