Examples of TokenStore


Examples of org.apache.cxf.ws.security.tokenstore.TokenStore

        }
        Destination destination = ex.getDestination();
        try {
            Endpoint endpoint = message.getExchange().get(Endpoint.class);
           
            TokenStore store = (TokenStore)message.getContextualProperty(TokenStore.class.getName());
            if (store == null) {
                store = new MemoryTokenStore();
                endpoint.getEndpointInfo().setProperty(TokenStore.class.getName(), store);
            }
            endpoint = STSUtils.createSTSEndpoint(bus,
View Full Code Here

Examples of org.apache.cxf.ws.security.tokenstore.TokenStore

                    }
                   
                    if (requestType.endsWith("/Issue")) {
                        doIssue(requestEl, exchange, writer, prefix, namespace);
                    } else if (requestType.endsWith("/Cancel")) {
                        TokenStore store = (TokenStore)exchange.get(Endpoint.class).getEndpointInfo()
                            .getProperty(TokenStore.class.getName());
                        cancelToken.setState(SecurityToken.State.CANCELLED);
                        store.update(cancelToken);
                        writer.writeEmptyElement(prefix, "RequestedTokenCancelled", namespace);
                        exchange.put(SecurityConstants.TOKEN, cancelToken);
                    } else if (requestType.endsWith("/Renew")) {
                        //REVISIT - implement
                    }
View Full Code Here

Examples of org.apache.cxf.ws.security.tokenstore.TokenStore

        }

        private SecurityToken findCancelToken(Exchange exchange, Element el) throws WSSecurityException {
            SecurityTokenReference ref = new SecurityTokenReference(DOMUtils.getFirstElement(el));
            String uri = ref.getReference().getURI();
            TokenStore store = (TokenStore)exchange.get(Endpoint.class).getEndpointInfo()
                    .getProperty(TokenStore.class.getName());
            return store.getToken(uri);
        }
View Full Code Here

Examples of org.apache.cxf.ws.security.tokenstore.TokenStore

        this.getInFaultInterceptors().add(new IssuedTokenInInterceptor());
    }
   
   
    static final TokenStore getTokenStore(Message message) {
        TokenStore tokenStore = (TokenStore)message.getContextualProperty(TokenStore.class.getName());
        if (tokenStore == null) {
            tokenStore = new MemoryTokenStore();
            message.getExchange().get(Endpoint.class).getEndpointInfo()
                .setProperty(TokenStore.class.getName(), tokenStore);
        }
View Full Code Here

Examples of org.apache.cxf.ws.security.tokenstore.TokenStore

       
        msg.getExchange().get(Endpoint.class).put(SecurityConstants.TOKEN_ID,
                issuedToken.getId());
        msg.getExchange().put(SecurityConstants.TOKEN_ID, issuedToken.getId());
       
        TokenStore tokenStore = new MemoryTokenStore();
        msg.getExchange().get(Endpoint.class).getEndpointInfo()
            .setProperty(TokenStore.class.getName(), tokenStore);
        tokenStore.add(issuedToken);
       
        // fire the interceptor and verify results
        final Document signedDoc = this.runOutInterceptorAndValidate(
                msg, policy, aim, null, null);
       
View Full Code Here

Examples of org.apache.cxf.ws.security.tokenstore.TokenStore

            service.getPort(portQName, DoubleItPortType.class);
        updateAddressPort(port, PORT);
       
        TokenTestUtils.updateSTSPort((BindingProvider)port, STSPORT2);
       
        TokenStore tokenStore = new MemoryTokenStore();
        ((BindingProvider)port).getRequestContext().put(
            TokenStore.class.getName(), tokenStore
        );

        // Make a successful invocation
View Full Code Here

Examples of org.apache.cxf.ws.security.tokenstore.TokenStore

            service.getPort(portQName, DoubleItPortType.class);
        updateAddressPort(port, PORT);
       
        TokenTestUtils.updateSTSPort((BindingProvider)port, STSPORT2);
       
        TokenStore tokenStore = new MemoryTokenStore();
        ((BindingProvider)port).getRequestContext().put(
            TokenStore.class.getName(), tokenStore
        );

        // Make a successful invocation
View Full Code Here

Examples of org.apache.cxf.ws.security.tokenstore.TokenStore

        Client client = ClientProxy.getClient(transportSaml2Port);
        Endpoint ep = client.getEndpoint();
        String id = "1234";
        ep.getEndpointInfo().setProperty(TokenStore.class.getName(), new MemoryTokenStore());
        ep.getEndpointInfo().setProperty(SecurityConstants.TOKEN_ID, id);
        TokenStore store = (TokenStore)ep.getEndpointInfo().getProperty(TokenStore.class.getName());

        SAMLCallback samlCallback = new SAMLCallback();
        SAMLUtil.doSAMLCallback(new Saml2CallbackHandler(), samlCallback);
        SamlAssertionWrapper assertion = new SamlAssertionWrapper(samlCallback);
        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        dbf.setNamespaceAware(true);
        DocumentBuilder db = dbf.newDocumentBuilder();
        Element assertionElement = assertion.toDOM(db.newDocument());
       
        SecurityToken tok = new SecurityToken(id);
        tok.setTokenType(WSConstants.WSS_SAML2_TOKEN_TYPE);
        tok.setToken(assertionElement);
        store.add(tok);
       
        doubleIt(transportSaml2Port, 50);
       
        ((java.io.Closeable)transportSaml2Port).close();
        bus.shutdown(true);
View Full Code Here

Examples of org.apache.cxf.ws.security.tokenstore.TokenStore

        }
        Destination destination = ex.getDestination();
        try {
            Endpoint endpoint = message.getExchange().getEndpoint();

            TokenStore store = getTokenStore(message);
            if (secConv) {
                endpoint = STSUtils.createSCEndpoint(bus,
                                                     namespace,
                                                     endpoint.getEndpointInfo().getTransportId(),
                                                     destination.getAddress().getAddress().getValue(),
View Full Code Here

Examples of org.apache.cxf.ws.security.tokenstore.TokenStore

    }
   
    public static TokenStore getTokenStore(Message message, boolean create) {
        EndpointInfo info = message.getExchange().get(Endpoint.class).getEndpointInfo();
        synchronized (info) {
            TokenStore tokenStore =
                (TokenStore)message.getContextualProperty(SecurityConstants.TOKEN_STORE_CACHE_INSTANCE);
            if (tokenStore == null) {
                tokenStore = (TokenStore)info.getProperty(SecurityConstants.TOKEN_STORE_CACHE_INSTANCE);
            }
            if (create && tokenStore == null) {
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.