Package com.sun.xml.ws.security.trust.impl.client

Examples of com.sun.xml.ws.security.trust.impl.client.DefaultSTSIssuedTokenConfiguration


    }

    private Element getSAMLAssertionFromSTS() {
        String stsEndpoint = "http://localhost:8080/jaxws-fs-sts/sts";
        String stsMexAddress = "http://localhost:8080/jaxws-fs-sts/sts/mex";
        DefaultSTSIssuedTokenConfiguration config = new DefaultSTSIssuedTokenConfiguration(
                    stsEndpoint, stsMexAddress);
          
        config.setKeyType("http://schemas.xmlsoap.org/ws/2005/05/identity/NoProofKey");
         
        try{
            IssuedTokenManager manager = IssuedTokenManager.getInstance();
          
            String appliesTo = "http://localhost:8080/jaxws-fs/simple";
View Full Code Here


    public void validate(Element assertion) throws SAMLValidationException {
        if (assertion != null){  
            String stsEndpoint = "http://localhost:8080/jaxws-fs-sts/sts/validate";
            String stsMexAddress = "http://localhost:8080/jaxws-fs-sts/sts/mex";
            DefaultSTSIssuedTokenConfiguration config = new DefaultSTSIssuedTokenConfiguration(
                        stsEndpoint, stsMexAddress);
            Status status = null;
            try{
                IssuedTokenManager manager = IssuedTokenManager.getInstance();
View Full Code Here

    }

    private void ping(){
        PingService service = new PingService();

        STSIssuedTokenConfiguration config = new DefaultSTSIssuedTokenConfiguration();
        Token actAsToken = getActAsToken();
        config.getOtherOptions().put(STSIssuedTokenConfiguration.ACT_AS, actAsToken);
        STSIssuedTokenFeature feature = new STSIssuedTokenFeature(config);

        IPingService stub = service.getCustomBindingIPingService(new WebServiceFeature[]{feature});
        stub.ping(new Holder("1"), new Holder("sun"), new Holder("Passed!"));
    }
View Full Code Here

    throws ServletException, IOException {
        response.setContentType("text/html;charset=UTF-8");
        PrintWriter out = response.getWriter();
        try {
            out.println("<h2>Servlet ClientServlet at " + request.getContextPath () + "</h2>");
                DefaultSTSIssuedTokenConfiguration config = new DefaultSTSIssuedTokenConfiguration();
                STSIssuedTokenFeature feature = new STSIssuedTokenFeature(config);
                org.me.calculator.client.CalculatorWS port = service.getCalculatorWSPort(new WebServiceFeature[]{feature});

                int i = Integer.parseInt(request.getParameter("value1"));
                int j = Integer.parseInt(request.getParameter("value2"));

                config.setTokenType("urn:oasis:names:tc:SAML:1.0:assertion");
                MyClaims claims = new MyClaims();
                claims.addClaimType(MyClaims.ROLE);
                config.setClaims(claims);
                int result = port.add(i, j);
               
                out.println("<br/>");
                out.println("Result:");
                out.println("" + i + " + " + j + " = " + result);
                out.println("<br/>");
                config.setTokenType("urn:oasis:names:tc:SAML:2.0:assertion");
                MyClaims claims1 = new MyClaims();
                claims1.addClaimType(MyClaims.LOCALITY);
                config.setClaims(claims1);
                result = port.add(i, j);

                out.println("<br/>");
                out.println("Result:");
                out.println("" + i + " + " + j + " = " + result);
View Full Code Here

                        if (stsMEXAddress == null) {
                            String stsNamespace = (String) packet.invocationProperties.get(STSIssuedTokenConfiguration.STS_NAMESPACE);
                            String stsWSDLLocation = (String) packet.invocationProperties.get(STSIssuedTokenConfiguration.STS_WSDL_LOCATION);
                            String stsServiceName = (String) packet.invocationProperties.get(STSIssuedTokenConfiguration.STS_SERVICE_NAME);
                            String stsPortName = (String) packet.invocationProperties.get(STSIssuedTokenConfiguration.STS_PORT_NAME);
                            config = new DefaultSTSIssuedTokenConfiguration(wsTrustVer.getNamespaceURI(), stsEndpoint, stsWSDLLocation, stsServiceName, stsPortName, stsNamespace);
                        } else {
                            config = new DefaultSTSIssuedTokenConfiguration(wsTrustVer.getNamespaceURI(), stsEndpoint, stsMEXAddress);
                        }
                    }

                    // Create config from IssuedToken and PreConfiguredSTS
                    if (config == null) {
                        config = new DefaultSTSIssuedTokenConfiguration(wsTrustVer.getNamespaceURI(), (IssuedToken) issuedTokenAssertion, preSetSTSAssertion);
                    }

                    config.getOtherOptions().putAll(packet.invocationProperties);

                    // put the server certificate, if available, in the configuration
View Full Code Here

                        if (stsMEXAddress == null) {
                            String stsNamespace = (String) packet.invocationProperties.get(STSIssuedTokenConfiguration.STS_NAMESPACE);
                            String stsWSDLLocation = (String) packet.invocationProperties.get(STSIssuedTokenConfiguration.STS_WSDL_LOCATION);
                            String stsServiceName = (String) packet.invocationProperties.get(STSIssuedTokenConfiguration.STS_SERVICE_NAME);
                            String stsPortName = (String) packet.invocationProperties.get(STSIssuedTokenConfiguration.STS_PORT_NAME);
                            config = new DefaultSTSIssuedTokenConfiguration(wsTrustVer.getNamespaceURI(), stsEndpoint, stsWSDLLocation, stsServiceName, stsPortName, stsNamespace);
                        } else {
                            config = new DefaultSTSIssuedTokenConfiguration(wsTrustVer.getNamespaceURI(), stsEndpoint, stsMEXAddress);
                        }
                    }

                    // Create config from IssuedToken and PreConfiguredSTS
                    if (config == null) {
                        config = new DefaultSTSIssuedTokenConfiguration(wsTrustVer.getNamespaceURI(), (IssuedToken) issuedTokenAssertion, preSetSTSAssertion);
                    }

                    config.getOtherOptions().putAll(packet.invocationProperties);

                    // put the server certificate, if available, in the configuration
View Full Code Here

TOP

Related Classes of com.sun.xml.ws.security.trust.impl.client.DefaultSTSIssuedTokenConfiguration

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.