Examples of AuthenticationResult


Examples of org.apache.uima.ducc.common.authentication.AuthenticationResult

    }
    return retVal;
  }
 
  private IAuthenticationResult checkUserExcluded(String userid) {
    IAuthenticationResult retVal = new AuthenticationResult(IAuthenticationResult.SUCCESS);
    if(userid == null) {
      retVal.setFailure();
      retVal.setReason("userid missing");
    }
    else {
      String uid = transform(userid);
      String excludeString = transform(getProperty(DuccPropertiesResolver.ducc_authentication_users_exclude));
      if(excludeString.trim().length() > 0) {
        if(finder(uid,excludeString)) {
          retVal.setFailure();
          retVal.setReason("userid excluded");
        }
      }
    }
    return retVal;
  }
View Full Code Here

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

            if ( user.isLocked() )
            {
                throw new UnauthorizedException( "User account is locked." );
            }

            AuthenticationResult authn = new AuthenticationResult( true, principal, null );
            SecuritySession securitySession = new DefaultSecuritySession( authn, user );

            return securitySystem.isAuthorized( securitySession, ArchivaRoleConstants.OPERATION_REPOSITORY_ACCESS,
                                                repoId );
        }
View Full Code Here

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

        {
            throw new ArchivaRestServiceException( "user " + userName + " not found" );
        }

        // check karma on source : read
        AuthenticationResult authn = new AuthenticationResult( true, userName, null );
        SecuritySession securitySession = new DefaultSecuritySession( authn, user );
        try
        {
            boolean authz =
                securitySystem.isAuthorized( securitySession, ArchivaRoleConstants.OPERATION_REPOSITORY_ACCESS,
View Full Code Here

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

    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

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

               
                authenticationSuccess = true;
                user.setCountFailedLoginAttempts( 0 );
                userManager.updateUser( user );
               
                return new AuthenticationResult( true, source.getPrincipal(), null );
            }
            else
            {
                getLogger().warn( "Password is Invalid for user " + source.getPrincipal() + "." );
                authnResultExceptionsMap.put( AuthenticationConstants.AUTHN_NO_SUCH_USER,
                    "Password is Invalid for user " + source.getPrincipal() + "." );
               
                try
                {
                    securityPolicy.extensionExcessiveLoginAttempts( user );
                }
                finally
                {
                    userManager.updateUser( user );
                }
               
                return new AuthenticationResult( false, source.getPrincipal(), null, authnResultExceptionsMap );
            }
        }
        catch ( UserNotFoundException e )
        {
            getLogger().warn( "Login for user " + source.getPrincipal() + " failed. user not found." );
            resultException = e;
            authnResultExceptionsMap.put( AuthenticationConstants.AUTHN_NO_SUCH_USER,
                "Login for user \" + source.getPrincipal() + \" failed. user not found." );
        }
       
        return new AuthenticationResult(authenticationSuccess, username, resultException, authnResultExceptionsMap );
    }
View Full Code Here

Examples of org.gatein.wci.authentication.AuthenticationResult

   }

   /** . */
   public AuthenticationResult login(HttpServletRequest request, HttpServletResponse response, String userName, String password, long validityMillis) throws ServletException
   {
      AuthenticationResult result = registration.context.login(request, response, userName, password, validityMillis);

      //
      if (!(result instanceof GenericAuthenticationResult))
      {
         fireEvent(EventType.LOGIN, new AuthenticationEvent(request, response, new Credentials(userName, password)));
View Full Code Here

Examples of org.onebusaway.everylastlogin.server.AuthenticationResult

  public Authentication attemptAuthentication(HttpServletRequest request)
      throws AuthenticationException {

    String mode = request.getParameter("mode");

    AuthenticationResult result = LoginManager.getResult(request);
    if (result == null)
      throw new EveryLastLoginAuthenticationException(
          "AuthenticationResult not found", mode);

    if (result.getCode() != EResultCode.SUCCESS)
      throw new EveryLastLoginAuthenticationException(
          "AuthenticationResult failure", mode);

    IndexedUserDetails details = _currentUserService.handleUserAction(
        result.getProvider(), result.getIdentity(), result.getCredentials(),
        false, mode);

    if (details == null)
      throw new EveryLastLoginAuthenticationException("could not get user details", mode);
View Full Code Here

Examples of org.picketlink.Identity.AuthenticationResult

            if(session.getAttribute(SESSION_REDIRECT) == null) {
                session.setAttribute(SESSION_REDIRECT, request.getHeader(REFERER));
            }

            try {
                AuthenticationResult status = identity.login();
                if(status == AuthenticationResult.FAILED) {
                    if(response.getStatus() == 302) { // Authenticator is requesting a redirect
                        return;
                    }
                    response.setStatus(400);
View Full Code Here

Examples of org.uberfire.security.auth.AuthenticationResult

    @Override
    public AuthenticationResult authenticate( final Credential credential, final SecurityContext securityContext )
            throws AuthenticationException {
        if ( !supportsCredential( credential ) ) {
            return new AuthenticationResult() {
                @Override
                public List<String> getMessages() {
                    return new ArrayList<String>( 1 ) {{
                        add( "Credential not supported by " + DefaultAuthenticationProvider.class.getName() );
                    }};
                }

                @Override
                public AuthenticationStatus getStatus() {
                    return AuthenticationStatus.NONE;
                }

                @Override
                public Principal getPrincipal() {
                    return null;
                }
            };
        }

        final UserNameCredential realCredential = UserNameCredential.class.cast( credential );

        if ( !authenticationSource.authenticate( realCredential, securityContext ) ) {
            return new AuthenticationResult() {
                @Override
                public List<String> getMessages() {
                    return new ArrayList<String>( 1 ) {{
                        add( "Invalid credentials." );
                    }};
                }

                @Override
                public AuthenticationStatus getStatus() {
                    return AuthenticationStatus.FAILED;
                }

                @Override
                public Principal getPrincipal() {
                    return null;
                }
            };
        }

        return new AuthenticationResult() {
            @Override
            public List<String> getMessages() {
                return emptyList();
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.