Examples of AuthStatus


Examples of com.bradmcevoy.http.AuthenticationService.AuthStatus

        }
    }

    public AuthStatus checkAuthentication( HttpManager manager, Resource resource, Request request ) {
        log.trace( "checkAuthentication" );
        AuthStatus authStatus = authenticationService.authenticate( resource, request ); //handler.authenticate( auth.user, auth.password );
        if( authStatus == null ) {
            log.trace("checkAuthentication: null authStatus");
            return null;
        } else {
            log.trace("checkAuthentication: authStatus.failed =" + authStatus.loginFailed);
View Full Code Here

Examples of com.bradmcevoy.http.AuthenticationService.AuthStatus

        }
    }

    public boolean checkAuthorisation( HttpManager manager, Resource resource, Request request ) {
        log.trace("checkAuthorisation");
        AuthStatus authStatus = checkAuthentication( manager, resource, request );
       
        // a null authStatus means that no authentication was attempted, eg an anonymous request
        // it is up to the implementation to decide whether or not to allow anonymous access
        // however a failed login must always be rejected
        if( authStatus != null && authStatus.loginFailed ) {
View Full Code Here

Examples of com.bradmcevoy.http.AuthenticationService.AuthStatus

                }
                responseHandler.respondMethodNotImplemented( resource, response, request );
                return;
            }

            AuthStatus authStatus = resourceHandlerHelper.checkAuthentication( manager, resource, request );
            if( authStatus != null && authStatus.loginFailed ) {
                if( log.isTraceEnabled() ) {
                    log.trace( "authentication failed. respond with: " + responseHandler.getClass().getCanonicalName() + " resource: " + resource.getClass().getCanonicalName() );
                }
                responseHandler.respondUnauthorised( resource, response, request );
View Full Code Here

Examples of com.bradmcevoy.http.AuthenticationService.AuthStatus

                log.debug( "resource not compatible. Resource class: " + resource.getClass() + " handler: " + getClass() );
                responseHandler.respondMethodNotImplemented( resource, response, request );
                return;
            }

            AuthStatus authStatus = resourceHandlerHelper.checkAuthentication( manager, resource, request );
            if( authStatus != null && authStatus.loginFailed ) {
                log.debug( "authentication failed. respond with: " + responseHandler.getClass().getCanonicalName() + " resource: " + resource.getClass().getCanonicalName() );
                responseHandler.respondUnauthorised( resource, response, request );
                return;
            }
View Full Code Here

Examples of javax.security.auth.message.AuthStatus

      MessageInfo authParam = new GenericMessageInfo(request, request.getResponse());
      GeneralizedAuthenticationManager gam = getAuthenticationManager();
      Subject clientSubject = new Subject();
      Subject serviceSubject = new Subject();
      Map sharedState = getSharedState(request,config);
      AuthStatus status = AuthStatus.FAILURE;
      while(!status.equals(AuthStatus.SEND_CONTINUE))
      {
         status = gam.validateRequest(authParam, clientSubject, serviceSubject);
         if(status.equals(AuthStatus.FAILURE))
            throw new SecurityException("Authentication failed");
      }
      Principal authenticatedPrincipal = this.getAuthenticatedPrincipal(clientSubject);
      return null;
      /*
 
View Full Code Here

Examples of javax.security.auth.message.AuthStatus

      MessageInfo authParam = new GenericMessageInfo(request,response);
      GeneralizedAuthenticationManager gam = getAuthenticationManager();
      Subject clientSubject = new Subject();
      Subject serviceSubject = new Subject();
      Map sharedState = getSharedState(request,config);
      AuthStatus status = AuthStatus.FAILURE;
      while(!status.equals(AuthStatus.SEND_CONTINUE))
      {
         status = gam.validateRequest(authParam, clientSubject, serviceSubject);
         if(status.equals(AuthStatus.FAILURE))
            throw new SecurityException("Authentication failed");
      }
      Principal authenticatedPrincipal = this.getAuthenticatedPrincipal(clientSubject);
      return null;
      /*
 
View Full Code Here

Examples of javax.security.auth.message.AuthStatus

            request.setNote(MESSAGE_INFO_KEY, messageInfo);
            String authContextId = serverAuthConfig.getAuthContextID(messageInfo);
            ServerAuthContext authContext = serverAuthConfig.getAuthContext(authContextId, serviceSubject, authProperties);
            Subject clientSubject = new Subject();

            AuthStatus authStatus = authContext.validateRequest(messageInfo, clientSubject, serviceSubject);
            if (authStatus == AuthStatus.SEND_CONTINUE)
                return new AuthResult(TomcatAuthStatus.SEND_CONTINUE, null);
            if (authStatus == AuthStatus.SEND_FAILURE)
                return new AuthResult(TomcatAuthStatus.SEND_FAILURE, null);
View Full Code Here

Examples of javax.security.auth.message.AuthStatus

        try
        {
            String authContextId = serverAuthConfig.getAuthContextID(messageInfo);
            ServerAuthContext authContext = serverAuthConfig.getAuthContext(authContextId,serviceSubject,authProperties);
            // TODO authContext.cleanSubject(messageInfo,validatedUser.getUserIdentity().getSubject());
            AuthStatus status = authContext.secureResponse(messageInfo,serviceSubject);
            return (AuthStatus.SEND_SUCCESS.equals(status));
        }
        catch (AuthException e)
        {
            throw new ServerAuthException(e);
View Full Code Here

Examples of javax.security.auth.message.AuthStatus

            request.setNote(MESSAGE_INFO_KEY, messageInfo);
            String authContextId = serverAuthConfig.getAuthContextID(messageInfo);
            ServerAuthContext authContext = serverAuthConfig.getAuthContext(authContextId, serviceSubject, authProperties);
            Subject clientSubject = new Subject();

            AuthStatus authStatus = authContext.validateRequest(messageInfo, clientSubject, serviceSubject);
            if (authStatus == AuthStatus.SEND_CONTINUE)
                return new AuthResult(TomcatAuthStatus.SEND_CONTINUE, null, false);
            if (authStatus == AuthStatus.SEND_FAILURE)
                return new AuthResult(TomcatAuthStatus.SEND_FAILURE, null, false);
View Full Code Here

Examples of javax.security.auth.message.AuthStatus

        if (messageInfo==null) throw new NullPointerException("MessageInfo from request missing: " + request);
        try
        {
            String authContextId = serverAuthConfig.getAuthContextID(messageInfo);
            ServerAuthContext authContext = serverAuthConfig.getAuthContext(authContextId,serviceSubject,authProperties);
            AuthStatus status = authContext.secureResponse(messageInfo,serviceSubject);
            return (AuthStatus.SEND_SUCCESS.equals(status));
        }
        catch (AuthException e)
        {
            throw new ServerAuthException(e);
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.