Package org.codehaus.plexus.redback.authentication

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


        archivaDavResourceFactory.setHttpAuth( httpAuth );
        archivaDavResourceFactory.setServletAuth( servletAuth );

        servlet.setResourceFactory( archivaDavResourceFactory );

        AuthenticationResult result = new AuthenticationResult();
        httpAuthControl.expectAndReturn( httpAuth.getAuthenticationResult( null, null ), result );
        servletAuthControl.expectAndReturn( servletAuth.isAuthenticated( null, null ), true );

        // ArchivaDavResourceFactory#isAuthorized()
        SecuritySession session = new DefaultSecuritySession();
View Full Code Here


        archivaDavResourceFactory.setHttpAuth( httpAuth );
        archivaDavResourceFactory.setServletAuth( servletAuth );

        servlet.setResourceFactory( archivaDavResourceFactory );

        AuthenticationResult result = new AuthenticationResult();
        httpAuthControl.expectAndReturn( httpAuth.getAuthenticationResult( null, null ), result );
        servletAuthControl.expectAndReturn( servletAuth.isAuthenticated( null, null ), true );

        // ArchivaDavResourceFactory#isAuthorized()
        SecuritySession session = new DefaultSecuritySession();
View Full Code Here

        for ( String repoId : repoIds )
        {
            try
            {
                AuthenticationResult result = httpAuth.getAuthenticationResult( req, null );
                SecuritySession securitySession = httpAuth.getSecuritySession();

                if ( servletAuth.isAuthenticated( req, result ) &&
                    servletAuth.isAuthorized( req, securitySession, repoId, false ) )
                {
View Full Code Here

    protected boolean isAuthorized( DavServletRequest request, String repositoryId )
        throws DavException
    {
        try
        {
            AuthenticationResult result = httpAuth.getAuthenticationResult( request, null );
            SecuritySession securitySession = httpAuth.getSecuritySession( request.getSession( true ) );

            return servletAuth.isAuthenticated( request, result ) && servletAuth.isAuthorized( request, securitySession,
                                                                                               repositoryId,
                                                                                               WebdavMethodUtil.getMethodPermission(
View Full Code Here

    }

    public SecuritySession authenticate( AuthenticationDataSource source )
        throws AuthenticationException, UserNotFoundException, AccountLockedException
    {
        AuthenticationResult result = null;
        SecuritySession session = null;

        if ( users.get( source.getPrincipal() ) != null )
        {
            result = new AuthenticationResult( true, source.getPrincipal(), null );

            User user = new JdoUser();
            user.setUsername( source.getPrincipal() );
            user.setPassword( users.get( source.getPrincipal() ) );

            session = new DefaultSecuritySession( result, user );
        }
        else
        {
            result = new AuthenticationResult( false, source.getPrincipal(), null );
            session = new DefaultSecuritySession( result );
        }
        return session;
    }
View Full Code Here

    protected boolean isAuthorized( DavServletRequest request, String repositoryId )
        throws DavException
    {  
        try
        {    
            AuthenticationResult result = httpAuth.getAuthenticationResult( request, null );
            SecuritySession securitySession = httpAuth.getSecuritySession();

            return servletAuth.isAuthenticated( request, result ) &&
                servletAuth.isAuthorized( request, securitySession, repositoryId,
                                          WebdavMethodUtil.isWriteMethod( request.getMethod() ) );
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)
            throws AuthenticationException, AccountLockedException, MustChangePasswordException
        {
            return new AuthenticationResult();
        }
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

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.