Package org.picketlink.identity.federation.ws.addressing

Examples of org.picketlink.identity.federation.ws.addressing.EndpointReferenceType


        if (tokenType != null) {
            writeTokenType(writer, tokenType);
        }

        // Deal with Issuer
        EndpointReferenceType endpoint = requestToken.getIssuer();
        if (endpoint != null) {
            StaxUtil.writeStartElement(writer, PREFIX, WSTrustConstants.ISSUER, BASE_NAMESPACE);
            StaxUtil.writeStartElement(writer, WSAddressingConstants.WSA_PREFIX, WSAddressingConstants.ADDRESS,
                    WSAddressingConstants.WSA_NS);
            StaxUtil.writeCharacters(writer, endpoint.getAddress().getValue());
            StaxUtil.writeEndElement(writer);
            StaxUtil.writeEndElement(writer);
        }

        // deal with the token lifetime.
View Full Code Here


                    // Look for addressing
                    subEvent = StaxParserUtil.getNextStartElement(xmlEventReader);
                    StaxParserUtil.validate(subEvent, WSAddressingConstants.ADDRESS);
                    String addressValue = StaxParserUtil.getElementText(xmlEventReader);

                    EndpointReferenceType endpointRef = new EndpointReferenceType();
                    AttributedURIType attrURI = new AttributedURIType();
                    attrURI.setValue(addressValue);
                    endpointRef.setAddress(new AttributedURIType());
                    requestToken.setIssuer(endpointRef);

                    EndElement endElement = StaxParserUtil.getNextEndElement(xmlEventReader);
                    StaxParserUtil.validate(endElement, WSTrustConstants.ISSUER);
                } else if (tag.equals(WSTrustConstants.SECONDARY_PARAMETERS)) {
View Full Code Here

        List<Object> contentList = appliesTo.getAny();
        if (contentList != null) {
            for (Object content : contentList) {
                if (content instanceof EndpointReferenceType) {
                    EndpointReferenceType endpointReference = (EndpointReferenceType) content;
                    WSAddressingWriter wsAddressingWriter = new WSAddressingWriter(this.writer);
                    wsAddressingWriter.write(endpointReference);
                }
            }
        }
View Full Code Here

     * @return the constructed {@code AppliesTo} instance.
     */
    public static AppliesTo createAppliesTo(String endpointURI) {
        AttributedURIType attributedURI = new AttributedURIType();
        attributedURI.setValue(endpointURI);
        EndpointReferenceType reference = new EndpointReferenceType();
        reference.setAddress(attributedURI);
        AppliesTo appliesTo = new AppliesTo();
        appliesTo.addAny(reference);

        return appliesTo;
    }
View Full Code Here

     * @return
     */
    public static EndpointReferenceType createIssuer(String addressUri) {
        AttributedURIType attributedURI = new AttributedURIType();
        attributedURI.setValue(addressUri);
        EndpointReferenceType endpointReference = new EndpointReferenceType();
        endpointReference.setAddress(attributedURI);
        return endpointReference;
    }
View Full Code Here

     *
     * @param appliesTo the {@code AppliesTo} instance to be parsed.
     * @return the address of the service provider.
     */
    public static String parseAppliesTo(AppliesTo appliesTo) {
        EndpointReferenceType reference = null;
        for (Object obj : appliesTo.getAny()) {
            if (obj instanceof EndpointReferenceType)
                reference = (EndpointReferenceType) obj;
            else if (obj instanceof JAXBElement) {
                JAXBElement<?> element = (JAXBElement<?>) obj;
                if (element.getName().getLocalPart().equalsIgnoreCase("EndpointReference"))
                    reference = (EndpointReferenceType) element.getValue();
            }

            if (reference != null && reference.getAddress() != null)
                return reference.getAddress().getValue();
        }
        return null;
    }
View Full Code Here

        assertEquals(SAMLUtil.SAML2_TOKEN_TYPE, rstr.getTokenType().toASCIIString());

        assertEquals(XMLTimeUtil.parse("2010-11-11T16:34:19.602Z"), rstr.getLifetime().getCreated());
        assertEquals(XMLTimeUtil.parse("2010-11-11T18:34:19.602Z"), rstr.getLifetime().getExpires());

        EndpointReferenceType endpoint = (EndpointReferenceType) rstr.getAppliesTo().getAny().get(0);
        assertEquals("http://services.testcorp.org/provider2", endpoint.getAddress().getValue());

        assertEquals(128, rstr.getKeySize());
        assertEquals(WSTrustConstants.KEY_TYPE_PUBLIC, rstr.getKeyType().toASCIIString());

        Element assertionElement = (Element) rstr.getRequestedSecurityToken().getAny().get(0);
View Full Code Here

        assertEquals("testcontext", requestToken.getContext());
        assertEquals(WSTrustConstants.ISSUE_REQUEST, requestToken.getRequestType().toASCIIString());

        AppliesTo appliesTo = requestToken.getAppliesTo();
        EndpointReferenceType endpoint = (EndpointReferenceType) appliesTo.getAny().get(0);
        assertEquals("http://services.testcorp.org/provider2", endpoint.getAddress().getValue());

        assertEquals("http://docs.oasis-open.org/ws-sx/ws-trust/200512/PublicKey", requestToken.getKeyType().toASCIIString());

        UseKeyType useKeyType = requestToken.getUseKey();
        Element certEl = (Element) useKeyType.getAny().get(0);
View Full Code Here

        assertEquals("testcontext", requestToken.getContext());
        assertEquals(WSTrustConstants.ISSUE_REQUEST, requestToken.getRequestType().toASCIIString());

        AppliesTo appliesTo = requestToken.getAppliesTo();
        EndpointReferenceType endpoint = (EndpointReferenceType) appliesTo.getAny().get(0);
        assertEquals("http://services.testcorp.org/provider2", endpoint.getAddress().getValue());

        // Now for the writing part
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        WSTrustRequestWriter rstWriter = new WSTrustRequestWriter(baos);
View Full Code Here

        assertEquals("testcontext", requestToken.getContext());
        assertEquals(WSTrustConstants.ISSUE_REQUEST, requestToken.getRequestType().toASCIIString());

        AppliesTo appliesTo = requestToken.getAppliesTo();
        EndpointReferenceType endpoint = (EndpointReferenceType) appliesTo.getAny().get(0);
        assertEquals("http://services.testcorp.org/provider2", endpoint.getAddress().getValue());

        assertEquals(WSTrustConstants.BS_TYPE_SYMMETRIC, requestToken.getKeyType().toASCIIString());

        EntropyType entropy = requestToken.getEntropy();
        BinarySecretType binarySecret = (BinarySecretType) entropy.getAny().get(0);
View Full Code Here

TOP

Related Classes of org.picketlink.identity.federation.ws.addressing.EndpointReferenceType

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.