Examples of SecurityTokenReferenceType


Examples of com.sun.xml.ws.security.secext10.SecurityTokenReferenceType

        }
    }
   
    public SecurityTokenReference createSecurityTokenReference(final JAXBElement elem){
        try {
            final SecurityTokenReferenceType type = (SecurityTokenReferenceType)elem.getValue();
            return new SecurityTokenReferenceImpl(type);
        } catch (Exception e) {
            log.log(Level.SEVERE,
                    LogStringsMessages.WST_0010_FAILED_CREATION_FROM_JAXBELE("STR"), e);
            throw new RuntimeException(LogStringsMessages.WST_0010_FAILED_CREATION_FROM_JAXBELE("STR"), e);
View Full Code Here

Examples of org.apache.cxf.ws.security.sts.provider.model.secext.SecurityTokenReferenceType

    protected static RequestedReferenceType createRequestedReference(
        TokenReference tokenReference, boolean attached
    ) {
        RequestedReferenceType requestedReferenceType =
            QNameConstants.WS_TRUST_FACTORY.createRequestedReferenceType();
        SecurityTokenReferenceType securityTokenReferenceType =
            QNameConstants.WSSE_FACTORY.createSecurityTokenReferenceType();
       
        // TokenType
        String tokenType = tokenReference.getWsse11TokenType();
        if (tokenType != null) {
            securityTokenReferenceType.getOtherAttributes().put(TOKEN_TYPE, tokenType);
        }
       
        if (tokenReference.isUseKeyIdentifier()) {
            String identifier = tokenReference.getIdentifier();
            if (identifier.charAt(0) == '#') {
                identifier = identifier.substring(1);
            }
           
            KeyIdentifierType keyIdentifierType =
                QNameConstants.WSSE_FACTORY.createKeyIdentifierType();
            keyIdentifierType.setValue(identifier);
            String valueType = tokenReference.getWsseValueType();
            if (valueType != null) {
                keyIdentifierType.setValueType(valueType);
            }
            JAXBElement<KeyIdentifierType> keyIdentifier =
                QNameConstants.WSSE_FACTORY.createKeyIdentifier(keyIdentifierType);
            securityTokenReferenceType.getAny().add(keyIdentifier);
        } else if (tokenReference.isUseDirectReference()) {
            String identifier = tokenReference.getIdentifier();
            if (attached && identifier.charAt(0) != '#') {
                identifier = "#" + identifier;
            } else if (!attached && identifier.charAt(0) == '#') {
                identifier = identifier.substring(1);
            }
           
            ReferenceType referenceType = QNameConstants.WSSE_FACTORY.createReferenceType();
            referenceType.setURI(identifier);
           
            String valueType = tokenReference.getWsseValueType();
            if (valueType != null) {
                referenceType.setValueType(valueType);
            }
            JAXBElement<ReferenceType> reference =
                QNameConstants.WSSE_FACTORY.createReference(referenceType);
            securityTokenReferenceType.getAny().add(reference);
        }
       
        requestedReferenceType.setSecurityTokenReference(securityTokenReferenceType);
       
        return requestedReferenceType;
View Full Code Here

Examples of org.apache.cxf.ws.security.sts.provider.model.secext.SecurityTokenReferenceType

                        }
                    }
                }
            } else if (SecurityTokenReferenceType.class == useKeyJaxb.getDeclaredType()
                || obj instanceof SecurityTokenReferenceType) {
                SecurityTokenReferenceType strType =
                    SecurityTokenReferenceType.class.cast(useKeyJaxb.getValue());
                Element token = fetchTokenElementFromReference(strType, wsContext);
                try {
                    x509 = Base64Utility.decode(token.getTextContent().trim());
                    LOG.fine("Found X509Certificate UseKey type via reference");
View Full Code Here

Examples of org.apache.cxf.ws.security.sts.provider.model.secext.SecurityTokenReferenceType

                        }
                    }
                }
            } else if (SecurityTokenReferenceType.class == useKeyJaxb.getDeclaredType()
                || obj instanceof SecurityTokenReferenceType) {
                SecurityTokenReferenceType strType =
                    SecurityTokenReferenceType.class.cast(useKeyJaxb.getValue());
                Element token = fetchTokenElementFromReference(strType, wsContext);
                try {
                    x509 = Base64Utility.decode(token.getTextContent().trim());
                    LOG.fine("Found X509Certificate UseKey type via reference");
View Full Code Here

Examples of org.apache.cxf.ws.security.sts.provider.model.secext.SecurityTokenReferenceType

    protected static RequestedReferenceType createRequestedReference(
        TokenReference tokenReference, boolean attached
    ) {
        RequestedReferenceType requestedReferenceType =
            QNameConstants.WS_TRUST_FACTORY.createRequestedReferenceType();
        SecurityTokenReferenceType securityTokenReferenceType =
            QNameConstants.WSSE_FACTORY.createSecurityTokenReferenceType();
       
        // Create the identifier according to whether it is an attached reference or not
        String identifier = tokenReference.getIdentifier();
        if (attached && identifier.charAt(0) != '#') {
            identifier = "#" + identifier;
        } else if (!attached && identifier.charAt(0) == '#') {
            identifier = identifier.substring(1);
        }
       
        // TokenType
        String tokenType = tokenReference.getWsse11TokenType();
        if (tokenType != null) {
            securityTokenReferenceType.getOtherAttributes().put(TOKEN_TYPE, tokenType);
        }
       
        if (tokenReference.isUseKeyIdentifier()) {
            KeyIdentifierType keyIdentifierType =
                QNameConstants.WSSE_FACTORY.createKeyIdentifierType();
            keyIdentifierType.setValue(identifier);
            String valueType = tokenReference.getWsseValueType();
            if (valueType != null) {
                keyIdentifierType.setValueType(valueType);
            }
            JAXBElement<KeyIdentifierType> keyIdentifier =
                QNameConstants.WSSE_FACTORY.createKeyIdentifier(keyIdentifierType);
            securityTokenReferenceType.getAny().add(keyIdentifier);
        } else if (tokenReference.isUseDirectReference()) {
            ReferenceType referenceType = QNameConstants.WSSE_FACTORY.createReferenceType();
            referenceType.setURI(identifier);
           
            String valueType = tokenReference.getWsseValueType();
            if (valueType != null) {
                referenceType.setValueType(valueType);
            }
            JAXBElement<ReferenceType> reference =
                QNameConstants.WSSE_FACTORY.createReference(referenceType);
            securityTokenReferenceType.getAny().add(reference);
        }
       
        requestedReferenceType.setSecurityTokenReference(securityTokenReferenceType);
       
        return requestedReferenceType;
View Full Code Here

Examples of org.apache.cxf.ws.security.sts.provider.model.secext.SecurityTokenReferenceType

    protected static RequestedReferenceType createRequestedReference(
        TokenReference tokenReference, boolean attached
    ) {
        RequestedReferenceType requestedReferenceType =
            QNameConstants.WS_TRUST_FACTORY.createRequestedReferenceType();
        SecurityTokenReferenceType securityTokenReferenceType =
            QNameConstants.WSSE_FACTORY.createSecurityTokenReferenceType();
       
        // Create the identifier according to whether it is an attached reference or not
        String identifier = tokenReference.getIdentifier();
        if (attached && identifier.charAt(0) != '#') {
            identifier = "#" + identifier;
        } else if (!attached && identifier.charAt(0) == '#') {
            identifier = identifier.substring(1);
        }
       
        // TokenType
        String tokenType = tokenReference.getWsse11TokenType();
        if (tokenType != null) {
            securityTokenReferenceType.getOtherAttributes().put(TOKEN_TYPE, tokenType);
        }
       
        if (tokenReference.isUseKeyIdentifier()) {
            KeyIdentifierType keyIdentifierType =
                QNameConstants.WSSE_FACTORY.createKeyIdentifierType();
            keyIdentifierType.setValue(identifier);
            String valueType = tokenReference.getWsseValueType();
            if (valueType != null) {
                keyIdentifierType.setValueType(valueType);
            }
            JAXBElement<KeyIdentifierType> keyIdentifier =
                QNameConstants.WSSE_FACTORY.createKeyIdentifier(keyIdentifierType);
            securityTokenReferenceType.getAny().add(keyIdentifier);
        } else if (tokenReference.isUseDirectReference()) {
            ReferenceType referenceType = QNameConstants.WSSE_FACTORY.createReferenceType();
            referenceType.setURI(identifier);
           
            String valueType = tokenReference.getWsseValueType();
            if (valueType != null) {
                referenceType.setValueType(valueType);
            }
            JAXBElement<ReferenceType> reference =
                QNameConstants.WSSE_FACTORY.createReference(referenceType);
            securityTokenReferenceType.getAny().add(reference);
        }
       
        requestedReferenceType.setSecurityTokenReference(securityTokenReferenceType);
       
        return requestedReferenceType;
View Full Code Here

Examples of org.apache.cxf.ws.security.sts.provider.model.secext.SecurityTokenReferenceType

                            }
                        }
                    }
                }
            } else if (SecurityTokenReferenceType.class == useKeyJaxb.getDeclaredType()) {
                SecurityTokenReferenceType strType =
                    SecurityTokenReferenceType.class.cast(useKeyJaxb.getValue());
                Element token = fetchTokenElementFromReference(strType, wsContext);
                try {
                    x509 = Base64Utility.decode(token.getTextContent());
                    LOG.fine("Found X509Certificate UseKey type via reference");
View Full Code Here

Examples of org.apache.cxf.ws.security.sts.provider.model.secext.SecurityTokenReferenceType

        response.getAny().add(requestedToken);

        // RequestedAttachedReference
        RequestedReferenceType requestedReferenceType = WS_TRUST_FACTORY
                .createRequestedReferenceType();
        SecurityTokenReferenceType securityTokenReferenceType = WSSE_FACTORY
                .createSecurityTokenReferenceType();
        KeyIdentifierType keyIdentifierType = WSSE_FACTORY
                .createKeyIdentifierType();
        keyIdentifierType.setValue(tokenId);
        JAXBElement<KeyIdentifierType> keyIdentifier = WSSE_FACTORY
                .createKeyIdentifier(keyIdentifierType);
       
        if (WSConstants.WSS_SAML_TOKEN_TYPE.equals(tokenType)
            || WSConstants.SAML_NS.equals(tokenType)) {
            securityTokenReferenceType.getOtherAttributes().put(
                TOKEN_TYPE, WSConstants.WSS_SAML_TOKEN_TYPE
            );
            keyIdentifierType.setValueType(WSConstants.WSS_SAML_KI_VALUE_TYPE);
        } else if (WSConstants.WSS_SAML2_TOKEN_TYPE.equals(tokenType)
            || WSConstants.SAML2_NS.equals(tokenType)) {
            securityTokenReferenceType.getOtherAttributes().put(
                TOKEN_TYPE, WSConstants.WSS_SAML2_TOKEN_TYPE
            );
            keyIdentifierType.setValueType(WSConstants.WSS_SAML2_KI_VALUE_TYPE);
        }
       
        securityTokenReferenceType.getAny().add(keyIdentifier);
        requestedReferenceType
                .setSecurityTokenReference(securityTokenReferenceType);

        JAXBElement<RequestedReferenceType> requestedAttachedReference = WS_TRUST_FACTORY
                .createRequestedAttachedReference(requestedReferenceType);
View Full Code Here

Examples of org.apache.cxf.ws.security.sts.provider.model.secext.SecurityTokenReferenceType

    protected static RequestedReferenceType createRequestedReference(
        TokenReference tokenReference, boolean attached
    ) {
        RequestedReferenceType requestedReferenceType =
            QNameConstants.WS_TRUST_FACTORY.createRequestedReferenceType();
        SecurityTokenReferenceType securityTokenReferenceType =
            QNameConstants.WSSE_FACTORY.createSecurityTokenReferenceType();
       
        // TokenType
        String tokenType = tokenReference.getWsse11TokenType();
        if (tokenType != null) {
            securityTokenReferenceType.getOtherAttributes().put(TOKEN_TYPE, tokenType);
        }
       
        if (tokenReference.isUseKeyIdentifier()) {
            String identifier = tokenReference.getIdentifier();
            if (identifier.charAt(0) == '#') {
                identifier = identifier.substring(1);
            }
           
            KeyIdentifierType keyIdentifierType =
                QNameConstants.WSSE_FACTORY.createKeyIdentifierType();
            keyIdentifierType.setValue(identifier);
            String valueType = tokenReference.getWsseValueType();
            if (valueType != null) {
                keyIdentifierType.setValueType(valueType);
            }
            JAXBElement<KeyIdentifierType> keyIdentifier =
                QNameConstants.WSSE_FACTORY.createKeyIdentifier(keyIdentifierType);
            securityTokenReferenceType.getAny().add(keyIdentifier);
        } else if (tokenReference.isUseDirectReference()) {
            String identifier = tokenReference.getIdentifier();
            if (attached && identifier.charAt(0) != '#') {
                identifier = "#" + identifier;
            } else if (!attached && identifier.charAt(0) == '#') {
                identifier = identifier.substring(1);
            }
           
            ReferenceType referenceType = QNameConstants.WSSE_FACTORY.createReferenceType();
            referenceType.setURI(identifier);
           
            String valueType = tokenReference.getWsseValueType();
            if (valueType != null) {
                referenceType.setValueType(valueType);
            }
            JAXBElement<ReferenceType> reference =
                QNameConstants.WSSE_FACTORY.createReference(referenceType);
            securityTokenReferenceType.getAny().add(reference);
        }
       
        requestedReferenceType.setSecurityTokenReference(securityTokenReferenceType);
       
        return requestedReferenceType;
View Full Code Here

Examples of org.apache.cxf.ws.security.sts.provider.model.secext.SecurityTokenReferenceType

                        }
                    }
                }
            } else if (SecurityTokenReferenceType.class == useKeyJaxb.getDeclaredType()
                || obj instanceof SecurityTokenReferenceType) {
                SecurityTokenReferenceType strType =
                    SecurityTokenReferenceType.class.cast(useKeyJaxb.getValue());
                Element token = fetchTokenElementFromReference(strType, wsContext);
                try {
                    x509 = Base64Utility.decode(token.getTextContent().trim());
                    LOG.fine("Found X509Certificate UseKey type via reference");
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.