Package org.apache.cxf.sts.token.canceller

Examples of org.apache.cxf.sts.token.canceller.TokenCancellerParameters


   
    public RequestSecurityTokenResponseType cancel(
        RequestSecurityTokenType request, WebServiceContext context
    ) {
        long start = System.currentTimeMillis();
        TokenCancellerParameters cancellerParameters = new TokenCancellerParameters();
       
        try {
            RequestParser requestParser = parseRequest(request, context);
           
            KeyRequirements keyRequirements = requestParser.getKeyRequirements();
            TokenRequirements tokenRequirements = requestParser.getTokenRequirements();
           
            cancellerParameters.setStsProperties(stsProperties);
            cancellerParameters.setPrincipal(context.getUserPrincipal());
            cancellerParameters.setWebServiceContext(context);
            cancellerParameters.setTokenStore(getTokenStore());
           
            cancellerParameters.setKeyRequirements(keyRequirements);
            cancellerParameters.setTokenRequirements(tokenRequirements)
           
            ReceivedToken cancelTarget = tokenRequirements.getCancelTarget();
            if (cancelTarget == null || cancelTarget.getToken() == null) {
                throw new STSException("No element presented for cancellation", STSException.INVALID_REQUEST);
            }
            cancellerParameters.setToken(cancelTarget);
           
            if (tokenRequirements.getTokenType() == null) {
                tokenRequirements.setTokenType(STSConstants.STATUS);
                LOG.fine(
                    "Received TokenType is null, falling back to default token type: " + STSConstants.STATUS
View Full Code Here


            AbstractSTSEvent baseEvent = (AbstractSTSEvent)event;
            map.put(KEYS.TIME.name(), this.dateFormat.format(new Date(baseEvent.getTimestamp())));
            map.put(KEYS.OPERATION.name(), baseEvent.getOperation());
            map.put(KEYS.DURATION.name(), String.valueOf(baseEvent.getDuration()) + "ms");
           
            TokenCancellerParameters params = event.getTokenParameters();
            HttpServletRequest req = (HttpServletRequest)params.getWebServiceContext().
                getMessageContext().get(AbstractHTTPDestination.HTTP_REQUEST);
            map.put(KEYS.REMOTE_HOST.name(), req.getRemoteHost());
            map.put(KEYS.REMOTE_PORT.name(), String.valueOf(req.getRemotePort()));
            map.put(KEYS.URL.name(), (String)params.getWebServiceContext().
                    getMessageContext().get("org.apache.cxf.request.url"));
            map.put(KEYS.TOKENTYPE.name(), params.getTokenRequirements().getTokenType());
            if (params.getTokenRequirements().getActAs() != null) {
                map.put(KEYS.CANCEL_PRINCIPAL.name(),
                        params.getTokenRequirements().getCancelTarget().getPrincipal().getName());
            }
            if (params.getPrincipal() != null) {
                map.put(KEYS.WS_SEC_PRINCIPAL.name(), params.getPrincipal().getName());
            }
            //map.put(KEYS.REALM.name(), params.getRealm());
            //map.put(KEYS.APPLIESTO.name(), params.getAppliesToAddress());
            if (event instanceof AbstractSTSFailureEvent) {
                map.put(KEYS.STATUS.name(), "FAILURE");
View Full Code Here

            LOG.fine(
                "Received TokenType is null, falling back to default token type: " + STSConstants.STATUS
            );
        }
       
        TokenCancellerParameters cancellerParameters = new TokenCancellerParameters();
        cancellerParameters.setStsProperties(stsProperties);
        cancellerParameters.setPrincipal(context.getUserPrincipal());
        cancellerParameters.setWebServiceContext(context);
        cancellerParameters.setTokenStore(getTokenStore());
       
        cancellerParameters.setKeyRequirements(keyRequirements);
        cancellerParameters.setTokenRequirements(tokenRequirements);  
       
        //
        // Cancel token
        //
        TokenCancellerResponse tokenResponse = null;
View Full Code Here

   
    public RequestSecurityTokenResponseType cancel(
        RequestSecurityTokenType request, WebServiceContext context
    ) {
        long start = System.currentTimeMillis();
        TokenCancellerParameters cancellerParameters = new TokenCancellerParameters();
       
        try {
            RequestParser requestParser = parseRequest(request, context);
           
            KeyRequirements keyRequirements = requestParser.getKeyRequirements();
            TokenRequirements tokenRequirements = requestParser.getTokenRequirements();
           
            cancellerParameters.setStsProperties(stsProperties);
            cancellerParameters.setPrincipal(context.getUserPrincipal());
            cancellerParameters.setWebServiceContext(context);
            cancellerParameters.setTokenStore(getTokenStore());
           
            cancellerParameters.setKeyRequirements(keyRequirements);
            cancellerParameters.setTokenRequirements(tokenRequirements)
           
            ReceivedToken cancelTarget = tokenRequirements.getCancelTarget();
            if (cancelTarget == null || cancelTarget.getToken() == null) {
                throw new STSException("No element presented for cancellation", STSException.INVALID_REQUEST);
            }
            cancellerParameters.setToken(cancelTarget);
           
            if (tokenRequirements.getTokenType() == null) {
                tokenRequirements.setTokenType(STSConstants.STATUS);
                LOG.fine(
                    "Received TokenType is null, falling back to default token type: " + STSConstants.STATUS
View Full Code Here

        }
        map.put(KEYS.REALM.name(), params.getRealm());
    }
   
    protected void handleEvent(TokenCancellerParametersSupport event, Map<String, Object> map) {
        TokenCancellerParameters params = event.getTokenParameters();
        HttpServletRequest req = (HttpServletRequest) params.getWebServiceContext().getMessageContext()
                .get(AbstractHTTPDestination.HTTP_REQUEST);
        map.put(KEYS.REMOTE_HOST.name(), req.getRemoteHost());
        map.put(KEYS.REMOTE_PORT.name(), String.valueOf(req.getRemotePort()));
        map.put(KEYS.URL.name(),
                (String) params.getWebServiceContext().getMessageContext().get("org.apache.cxf.request.url"));
        map.put(KEYS.TOKENTYPE.name(), params.getTokenRequirements().getTokenType());
        if (params.getTokenRequirements().getActAs() != null) {
            map.put(KEYS.CANCEL_PRINCIPAL.name(), params.getTokenRequirements().getCancelTarget().getPrincipal()
                    .getName());
        }
        if (params.getPrincipal() != null) {
            map.put(KEYS.WS_SEC_PRINCIPAL.name(), params.getPrincipal().getName());
        }
    }
View Full Code Here

            AbstractSTSEvent baseEvent = (AbstractSTSEvent)event;
            map.put(KEYS.TIME.name(), this.dateFormat.format(new Date(baseEvent.getTimestamp())));
            map.put(KEYS.OPERATION.name(), baseEvent.getOperation());
            map.put(KEYS.DURATION.name(), String.valueOf(baseEvent.getDuration()) + "ms");
           
            TokenCancellerParameters params = event.getTokenParameters();
            HttpServletRequest req = (HttpServletRequest)params.getWebServiceContext().
                getMessageContext().get(AbstractHTTPDestination.HTTP_REQUEST);
            map.put(KEYS.REMOTE_HOST.name(), req.getRemoteHost());
            map.put(KEYS.REMOTE_PORT.name(), String.valueOf(req.getRemotePort()));
            map.put(KEYS.URL.name(), (String)params.getWebServiceContext().
                    getMessageContext().get("org.apache.cxf.request.url"));
            map.put(KEYS.TOKENTYPE.name(), params.getTokenRequirements().getTokenType());
            if (params.getTokenRequirements().getActAs() != null) {
                map.put(KEYS.CANCEL_PRINCIPAL.name(),
                        params.getTokenRequirements().getCancelTarget().getPrincipal().getName());
            }
            if (params.getPrincipal() != null) {
                map.put(KEYS.WS_SEC_PRINCIPAL.name(), params.getPrincipal().getName());
            }
            //map.put(KEYS.REALM.name(), params.getRealm());
            //map.put(KEYS.APPLIESTO.name(), params.getAppliesToAddress());
            if (event instanceof AbstractSTSFailureEvent) {
                map.put(KEYS.STATUS.name(), "FAILURE");
View Full Code Here

        }
        map.put(KEYS.REALM.name(), params.getRealm());
    }
   
    protected void handleEvent(TokenCancellerParametersSupport event, Map<String, Object> map) {
        TokenCancellerParameters params = event.getTokenParameters();
        HttpServletRequest req = (HttpServletRequest) params.getWebServiceContext().getMessageContext()
                .get(AbstractHTTPDestination.HTTP_REQUEST);
        map.put(KEYS.REMOTE_HOST.name(), req.getRemoteHost());
        map.put(KEYS.REMOTE_PORT.name(), String.valueOf(req.getRemotePort()));
        map.put(KEYS.URL.name(),
                (String) params.getWebServiceContext().getMessageContext().get("org.apache.cxf.request.url"));
        map.put(KEYS.TOKENTYPE.name(), params.getTokenRequirements().getTokenType());
        if (params.getTokenRequirements().getActAs() != null) {
            map.put(KEYS.CANCEL_PRINCIPAL.name(), params.getTokenRequirements().getCancelTarget().getPrincipal()
                    .getName());
        }
        if (params.getPrincipal() != null) {
            map.put(KEYS.WS_SEC_PRINCIPAL.name(), params.getPrincipal().getName());
        }
    }
View Full Code Here

            LOG.fine(
                "Received TokenType is null, falling back to default token type: " + STSConstants.STATUS
            );
        }
       
        TokenCancellerParameters cancellerParameters = new TokenCancellerParameters();
        cancellerParameters.setStsProperties(stsProperties);
        cancellerParameters.setPrincipal(context.getUserPrincipal());
        cancellerParameters.setWebServiceContext(context);
        cancellerParameters.setTokenStore(getTokenStore());
       
        cancellerParameters.setKeyRequirements(keyRequirements);
        cancellerParameters.setTokenRequirements(tokenRequirements);  
        cancellerParameters.setToken(cancelTarget);
       
        //
        // Cancel token
        //
        TokenCancellerResponse tokenResponse = null;
View Full Code Here

TOP

Related Classes of org.apache.cxf.sts.token.canceller.TokenCancellerParameters

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.