Package org.eclipse.jetty.server

Examples of org.eclipse.jetty.server.UserIdentity


        }
        else if (header != null && header.startsWith(HttpHeaders.NEGOTIATE))
        {
            String spnegoToken = header.substring(10);
           
            UserIdentity user = _loginService.login(null,spnegoToken);
           
            if ( user != null )
            {
                return new UserAuthentication(getAuthMethod(),user);
            }
View Full Code Here


                    if (principal == null) principal = cert.getIssuerDN();
                    final String username = principal == null ? "clientcert" : principal.getName();

                    final char[] credential = B64Code.encode(cert.getSignature());

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

     * @param info a UserIdentity instance, or a String password or Credential instance
     * @return User instance
     */
    protected synchronized UserIdentity putUser(String userName, Object info)
    {
        final UserIdentity identity;
        if (info instanceof UserIdentity)
            identity=(UserIdentity)info;
        else
        {
            Credential credential = (info instanceof Credential)?(Credential)info:Credential.getCredential(info.toString());
View Full Code Here

        if (roles!=null)
            for (String role : roles)
                subject.getPrincipals().add(new RolePrincipal(role));

        subject.setReadOnly();
        UserIdentity identity=_identityService.newUserIdentity(subject,userPrincipal,roles);
        _users.put(userName,identity);
        return identity;
    }
View Full Code Here

    /**
     * @see org.eclipse.jetty.security.LoginService#login(java.lang.String, java.lang.Object)
     */
    public UserIdentity login(String username, Object credentials)
    {
        UserIdentity user = _users.get(username);
       
        if (user==null)
            user = loadUser(username);
       
        if (user!=null)
        {
            UserPrincipal principal = (UserPrincipal)user.getUserPrincipal();
            if (principal.authenticate(credentials))
                return user;
        }
        return null;
    }
View Full Code Here

                        if (i>0)
                        {
                            String username = credentials.substring(0,i);
                            String password = credentials.substring(i+1);

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

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

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

            if (isJSecurityCheck(uri))
            {
                final String username = request.getParameter(__J_USERNAME);
                final String password = request.getParameter(__J_PASSWORD);
               
                UserIdentity user = _loginService.login(username,password);
                if (user!=null)
                {
                    session=renewSessionOnAuthentication(request,response);
                   
                    // Redirect to original request
View Full Code Here

     */
    public Authentication login(String username, String password)
    {
        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);
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

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.