Package org.codehaus.plexus.redback.authentication

Examples of org.codehaus.plexus.redback.authentication.AuthenticationResult


        if ( user.isLocked() )
        {
            throw new AccessDeniedException( "User " + principal + "(" + user.getFullName() + ") is locked." );
        }

        AuthenticationResult authn = new AuthenticationResult( true, principal, null );
        return new DefaultSecuritySession( authn, user );
    }
View Full Code Here


    }
   
    public SecuritySession authenticate( AuthenticationDataSource source )
        throws AuthenticationException, UserNotFoundException, AccountLockedException
    {
        AuthenticationResult result = new AuthenticationResult( true, source.getPrincipal(), null );
        return new DefaultSecuritySession( result );
    }
View Full Code Here

    {   
        final String repositoryId = RepositoryPathUtil.getRepositoryName( removeContextPath( request ) );
       
        try
        {
            AuthenticationResult result = httpAuth.getAuthenticationResult( request, null );
           
            //Create a dav session
            request.setDavSession(new ArchivaDavSession());
           
            return servletAuth.isAuthenticated( request, result );
View Full Code Here

        @Override
        public AuthenticationResult getAuthenticationResult(HttpServletRequest arg0, HttpServletResponse arg1)
            throws AuthenticationException, AccountLockedException, MustChangePasswordException
        {
            return new AuthenticationResult();
        }
View Full Code Here

        @Override
        public AuthenticationResult authenticate(AuthenticationDataSource arg0, HttpSession httpSession)
            throws AuthenticationException, AccountLockedException, MustChangePasswordException
        {
            return new AuthenticationResult();
        }
View Full Code Here

    }
   
    public void testIsAuthenticatedUserExists()
        throws Exception
    {
        AuthenticationResult result = new AuthenticationResult( true, "user", null );
        boolean isAuthenticated = servletAuth.isAuthenticated( request, result );
       
        assertTrue( isAuthenticated );
    }
View Full Code Here

    }
   
    public void testIsAuthenticatedUserDoesNotExist()
        throws Exception
    {
        AuthenticationResult result = new AuthenticationResult( false, "non-existing-user", null );
        try
        {
            servletAuth.isAuthenticated( request, result );
            fail( "Authentication exception should have been thrown." );
        }
View Full Code Here

        assignRepositoryManagerRole( USER_ALPACA, "corporate" );

        UserManager userManager = securitySystem.getUserManager();
        User user = userManager.findUser( USER_ALPACA );
       
        AuthenticationResult result = new AuthenticationResult( true, USER_ALPACA, null );
       
        SecuritySession session = new DefaultSecuritySession( result, user );
        boolean isAuthorized = servletAuth.isAuthorized( request, session, "corporate", true );
               
        assertTrue( isAuthorized );
View Full Code Here

        httpServletRequestControl.expectAndReturn( request.getRemoteAddr(), "192.168.111.111" );
       
        UserManager userManager = securitySystem.getUserManager();
        User user = userManager.findUser( USER_ALPACA );
       
        AuthenticationResult result = new AuthenticationResult( true, USER_ALPACA, null );
       
        SecuritySession session = new DefaultSecuritySession( result, user );
       
        httpServletRequestControl.replay();
       
View Full Code Here

        assignRepositoryObserverRole( USER_ALPACA, "corporate" );
       
        UserManager userManager = securitySystem.getUserManager();
        User user = userManager.findUser( USER_ALPACA );
       
        AuthenticationResult result = new AuthenticationResult( true, USER_ALPACA, null );
       
        SecuritySession session = new DefaultSecuritySession( result, user );
        boolean isAuthorized = servletAuth.isAuthorized( request, session, "corporate", false );
               
        assertTrue( isAuthorized );       
View Full Code Here

TOP

Related Classes of org.codehaus.plexus.redback.authentication.AuthenticationResult

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.